diff options
| author | John Reck <jreck@google.com> | 2011-03-01 10:17:19 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-01 10:17:19 -0800 |
| commit | 15c5087dba00b22a1a29b8e9074e3029a4a3dca1 (patch) | |
| tree | 683236dcb1fb69ac1b22c2be9b1581ca8c345763 /src/com/android/browser/Controller.java | |
| parent | ba782b277de41855eb549d5f48aee939d77d5e27 (diff) | |
| parent | 51d8baddb85b04bf870843399cb40f8713303671 (diff) | |
Merge "Change "Save Web Archive" to "Save Page""
Diffstat (limited to 'src/com/android/browser/Controller.java')
| -rw-r--r-- | src/com/android/browser/Controller.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 6e06e6e3..e72d7b3f 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1468,8 +1468,10 @@ public class Controller newtab.setEnabled(getTabControl().canCreateNewTab()); MenuItem archive = menu.findItem(R.id.save_webarchive_menu_id); - String url = w != null ? w.getUrl() : null; - archive.setVisible(url != null && !url.endsWith(".webarchivexml")); + Tab tab = getTabControl().getCurrentTab(); + String url = tab != null ? tab.getUrl() : null; + archive.setVisible(!TextUtils.isEmpty(url) + && !url.endsWith(".webarchivexml")); break; } mCurrentMenuState = mMenuState; @@ -1591,6 +1593,7 @@ public class Controller } WebView topWebView = getCurrentTopWebView(); final String title = topWebView.getTitle(); + final String url = topWebView.getUrl(); topWebView.saveWebArchive(directory, true, new ValueCallback<String>() { @Override @@ -1614,8 +1617,8 @@ public class Controller return; } } - Toast.makeText(mActivity, - R.string.webarchive_failed, Toast.LENGTH_SHORT).show(); + DownloadHandler.onDownloadStartNoStream(mActivity, + url, null, null, null); } }); break; |
