Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Unified Diff: content/browser/android/download_controller_android_impl.cc

Issue 1182293002: Save image should download the original image when Data Saver is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/android/download_controller_android_impl.cc
diff --git a/content/browser/android/download_controller_android_impl.cc b/content/browser/android/download_controller_android_impl.cc
index d8da51836f8b44754b555af927974795d304ffaa..68675b56d9ae2b83e5d64265b806d136f2be4740 100644
--- a/content/browser/android/download_controller_android_impl.cc
+++ b/content/browser/android/download_controller_android_impl.cc
@@ -390,7 +390,8 @@ DownloadControllerAndroidImpl::JavaObject*
}
void DownloadControllerAndroidImpl::StartContextMenuDownload(
- const ContextMenuParams& params, WebContents* web_contents, bool is_link) {
+ const ContextMenuParams& params, WebContents* web_contents, bool is_link,
+ const std::string& extra_headers) {
const GURL& url = is_link ? params.link_url : params.src_url;
const GURL& referring_url = params.frame_url.is_empty() ?
params.page_url : params.frame_url;
@@ -405,7 +406,11 @@ void DownloadControllerAndroidImpl::StartContextMenuDownload(
dl_params->set_referrer(referrer);
if (is_link)
dl_params->set_referrer_encoding(params.frame_charset);
- else
+ net::HttpRequestHeaders headers;
+ headers.AddHeadersFromString(extra_headers);
+ for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext();)
+ dl_params->add_request_header(it.name(), it.value());
+ if (!is_link && extra_headers.empty())
dl_params->set_prefer_cache(true);
dl_params->set_prompt(false);
dlm->DownloadUrl(dl_params.Pass());

Powered by Google App Engine
This is Rietveld 408576698