diff options
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r-- | src/com/android/browser/Controller.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 385d494..cf1518c 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -512,8 +512,8 @@ public class Controller case R.id.save_link_context_menu_id: case R.id.download_context_menu_id: DownloadHandler.onDownloadStartNoStream( - mActivity, url, null, null, null, null, - view.isPrivateBrowsingEnabled()); + mActivity, url, view.getSettings().getUserAgentString(), + null, null, null, view.isPrivateBrowsingEnabled()); break; } break; @@ -1434,9 +1434,9 @@ public class Controller return false; } }); - menu.findItem(R.id.download_context_menu_id). - setOnMenuItemClickListener( - new Download(mActivity, extra, webview.isPrivateBrowsingEnabled())); + menu.findItem(R.id.download_context_menu_id).setOnMenuItemClickListener( + new Download(mActivity, extra, webview.isPrivateBrowsingEnabled(), + webview.getSettings().getUserAgentString())); menu.findItem(R.id.set_wallpaper_context_menu_id). setOnMenuItemClickListener(new WallpaperHandler(mActivity, extra)); @@ -2166,6 +2166,7 @@ public class Controller private Activity mActivity; private String mText; private boolean mPrivateBrowsing; + private String mUserAgent; private static final String FALLBACK_EXTENSION = "dat"; private static final String IMAGE_BASE_FORMAT = "yyyy-MM-dd-HH-mm-ss-"; @@ -2174,16 +2175,18 @@ public class Controller if (DataUri.isDataUri(mText)) { saveDataUri(); } else { - DownloadHandler.onDownloadStartNoStream(mActivity, mText, null, + DownloadHandler.onDownloadStartNoStream(mActivity, mText, mUserAgent, null, null, null, mPrivateBrowsing); } return true; } - public Download(Activity activity, String toDownload, boolean privateBrowsing) { + public Download(Activity activity, String toDownload, boolean privateBrowsing, + String userAgent) { mActivity = activity; mText = toDownload; mPrivateBrowsing = privateBrowsing; + mUserAgent = userAgent; } /** |