Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Browser
Commits
0ced08c2
Commit
0ced08c2
authored
14 years ago
by
Elliott Slaughter
Browse files
Options
Download
Email Patches
Plain Diff
Browser save page as web archive.
Change-Id: I01366f575f61fd6e2084ad003b860f5c6083258e
parent
d9c3d74f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
AndroidManifest.xml
AndroidManifest.xml
+10
-0
res/menu-xlarge/browser.xml
res/menu-xlarge/browser.xml
+2
-0
res/menu/browser.xml
res/menu/browser.xml
+2
-0
res/values/strings.xml
res/values/strings.xml
+6
-0
src/com/android/browser/BrowserActivity.java
src/com/android/browser/BrowserActivity.java
+17
-0
No files found.
AndroidManifest.xml
View file @
0ced08c2
...
...
@@ -84,6 +84,16 @@
<data
android:mimeType=
"application/xhtml+xml"
/>
<data
android:mimeType=
"application/vnd.wap.xhtml+xml"
/>
</intent-filter>
<!-- For viewing saved web archives. -->
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<data
android:scheme=
"http"
/>
<data
android:scheme=
"https"
/>
<data
android:scheme=
"file"
/>
<data
android:mimeType=
"application/x-webarchive-xml"
/>
</intent-filter>
<!-- We are also the main entry point of the browser. -->
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
This diff is collapsed.
Click to expand it.
res/menu-xlarge/browser.xml
View file @
0ced08c2
...
...
@@ -44,6 +44,8 @@
android:title=
"@string/menu_preferences"
android:icon=
"@drawable/ic_menu_settings"
android:alphabeticShortcut=
"p"
/>
<item
android:id=
"@+id/save_webarchive_menu_id"
android:title=
"@string/menu_save_webarchive"
/>
<!-- followings are debug only -->
<item
android:id=
"@+id/dump_nav_menu_id"
android:title=
"@string/dump_nav"
...
...
This diff is collapsed.
Click to expand it.
res/menu/browser.xml
View file @
0ced08c2
...
...
@@ -59,6 +59,8 @@
android:title=
"@string/menu_preferences"
android:icon=
"@drawable/ic_menu_settings"
android:alphabeticShortcut=
"p"
/>
<item
android:id=
"@+id/save_webarchive_menu_id"
android:title=
"@string/menu_save_webarchive"
/>
<!-- followings are debug only -->
<item
android:id=
"@+id/dump_nav_menu_id"
android:title=
"@string/dump_nav"
...
...
This diff is collapsed.
Click to expand it.
res/values/strings.xml
View file @
0ced08c2
...
...
@@ -217,6 +217,12 @@
<string
name=
"copy_page_url"
>
Copy page url
</string>
<!-- Menu item -->
<string
name=
"share_page"
>
Share page
</string>
<!-- Menu item for saving a page as a web archive. -->
<string
name=
"menu_save_webarchive"
>
Save as Web Archive
</string>
<!-- Toast informing the user that the page has been saved. -->
<string
name=
"webarchive_saved"
>
Web archive saved.
</string>
<!-- Toast informing the user that saving the page has failed. -->
<string
name=
"webarchive_failed"
>
Failed to save web archive.
</string>
<!-- Context Menu item open the currently selected link in the current
window.-->
<string
name=
"contextmenu_openlink"
>
Open
</string>
...
...
This diff is collapsed.
Click to expand it.
src/com/android/browser/BrowserActivity.java
View file @
0ced08c2
...
...
@@ -1403,6 +1403,23 @@ public class BrowserActivity extends Activity
showFindDialog
();
break
;
case
R
.
id
.
save_webarchive_menu_id
:
if
(
LOGD_ENABLED
)
{
Log
.
d
(
LOGTAG
,
"Save as Web Archive"
);
}
String
directory
=
getExternalFilesDir
(
null
).
getAbsolutePath
()
+
File
.
separator
;
getTopWindow
().
saveWebArchive
(
directory
,
true
,
new
ValueCallback
<
String
>()
{
@Override
public
void
onReceiveValue
(
String
value
)
{
if
(
value
!=
null
)
{
Toast
.
makeText
(
BrowserActivity
.
this
,
R
.
string
.
webarchive_saved
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
Toast
.
makeText
(
BrowserActivity
.
this
,
R
.
string
.
webarchive_failed
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
});
break
;
case
R
.
id
.
page_info_menu_id
:
showPageInfo
(
mTabControl
.
getCurrentTab
(),
false
);
break
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment