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

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

Issue 1854523002: If a download is initiated by download attribute, don't use stream viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 abbd4c35d54e09f0b808a4544f75cf7b16a777cc..e0492d11280fdcbaab0f578856c04929cce54fc2 100644
--- a/content/browser/android/download_controller_android_impl.cc
+++ b/content/browser/android/download_controller_android_impl.cc
@@ -239,7 +239,8 @@ bool DownloadControllerAndroidImpl::HasFileAccessPermission(
}
void DownloadControllerAndroidImpl::CreateGETDownload(
- int render_process_id, int render_view_id, int request_id) {
+ int render_process_id, int render_view_id, int request_id,
+ bool must_download) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
GlobalRequestID global_id(render_process_id, request_id);
@@ -249,7 +250,7 @@ void DownloadControllerAndroidImpl::CreateGETDownload(
GetDownloadInfoCB cb = base::Bind(
&DownloadControllerAndroidImpl::StartAndroidDownload,
base::Unretained(this), render_process_id,
- render_view_id);
+ render_view_id, must_download);
PrepareDownloadInfo(
global_id,
@@ -343,7 +344,7 @@ void DownloadControllerAndroidImpl::StartDownloadOnUIThread(
}
void DownloadControllerAndroidImpl::StartAndroidDownload(
- int render_process_id, int render_view_id,
+ int render_process_id, int render_view_id, bool must_download,
const DownloadInfoAndroid& info) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -363,7 +364,7 @@ void DownloadControllerAndroidImpl::StartAndroidDownload(
web_contents,
base::Bind(&DownloadControllerAndroidImpl::StartAndroidDownload,
base::Unretained(this), render_process_id, render_view_id,
- info)));
+ must_download, info)));
return;
}
@@ -371,11 +372,11 @@ void DownloadControllerAndroidImpl::StartAndroidDownload(
web_contents,
base::Bind(&DownloadControllerAndroidImpl::StartAndroidDownloadInternal,
base::Unretained(this), render_process_id, render_view_id,
- info));
+ must_download, info));
}
void DownloadControllerAndroidImpl::StartAndroidDownloadInternal(
- int render_process_id, int render_view_id,
+ int render_process_id, int render_view_id, bool must_download,
const DownloadInfoAndroid& info, bool allowed) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!allowed)
@@ -418,7 +419,7 @@ void DownloadControllerAndroidImpl::StartAndroidDownloadInternal(
env, GetJavaObject()->Controller(env).obj(), view.obj(), jurl.obj(),
juser_agent.obj(), jcontent_disposition.obj(), jmime_type.obj(),
jcookie.obj(), jreferer.obj(), info.has_user_gesture, jfilename.obj(),
- info.total_bytes);
+ info.total_bytes, must_download);
}
void DownloadControllerAndroidImpl::OnDownloadStarted(

Powered by Google App Engine
This is Rietveld 408576698