diff options
author | Axesh R. Ajmera <aajmera@codeaurora.org> | 2015-04-10 16:26:52 -0700 |
---|---|---|
committer | WebTech Code Review <code-review@localhost> | 2015-04-15 08:07:51 -0700 |
commit | 75b811c30833a798b8fdc265713bb30faed25cab (patch) | |
tree | bf2a8e22963d570e890d8b250f84b0e4a526ea14 /src | |
parent | b1289f3c23d30d47ab7915b95d918c5327b4c129 (diff) | |
download | android_packages_apps_Gello-75b811c30833a798b8fdc265713bb30faed25cab.tar.gz android_packages_apps_Gello-75b811c30833a798b8fdc265713bb30faed25cab.tar.bz2 android_packages_apps_Gello-75b811c30833a798b8fdc265713bb30faed25cab.zip |
Use isSavable API for offline reading
This helps in saving pages for offline reading only
for valid mimetypes.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/Controller.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 80a5a424..353fea90 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1971,7 +1971,7 @@ public class Controller // items defined in res/menu/browser.xml should be enabled boolean isLiveScheme = false; boolean isPageFinished = false; - + boolean isSavable = false; resetMenuItems(menu); if (tab != null) { @@ -1980,6 +1980,7 @@ public class Controller isLive = !tab.isSnapshot(); isLiveScheme = UrlUtils.isLiveScheme(tab.getWebView().getUrl()); isPageFinished = (tab.getPageFinishedStatus() || !tab.inPageLoad()); + isSavable = tab.getWebView().isSavable(); } final MenuItem forward = menu.findItem(R.id.forward_menu_id); @@ -2008,7 +2009,7 @@ public class Controller setMenuItemVisibility(menu, R.id.add_to_homescreen, isLive && isLiveScheme && isPageFinished); setMenuItemVisibility(menu, R.id.save_snapshot_menu_id, - isLive && isLiveScheme && isPageFinished); + isLive && isLiveScheme && isPageFinished && isSavable); // history and snapshots item are the members of COMBO menu group, // so if show history item, only make snapshots item invisible. menu.findItem(R.id.snapshots_menu_id).setVisible(false); |