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

Unified Diff: chrome/browser/download/download_permission_request.cc

Issue 811163004: Update DownloadRequestLimiter tests for the permission bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whitespace Created 6 years 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: chrome/browser/download/download_permission_request.cc
diff --git a/chrome/browser/download/download_permission_request.cc b/chrome/browser/download/download_permission_request.cc
index c8ac3db4fab19736fb7764ee3f1cf3d912008de1..9e076a6c4e584233f4ef1e863e163279b2d7152d 100644
--- a/chrome/browser/download/download_permission_request.cc
+++ b/chrome/browser/download/download_permission_request.cc
@@ -28,9 +28,14 @@ base::string16 DownloadPermissionRequest::GetMessageTextFragment() const {
}
bool DownloadPermissionRequest::HasUserGesture() const {
- // TODO(gbillock): user gesture for multiple downloads is difficult to
- // propagate, and the normal thing is that it is background.
- return false;
+ // Only non-gestured requests go through the path of the download request
Randy Smith (Not in Mondays) 2014/12/22 18:30:28 Why do you say this? I'm not 100% confident in my
felt 2014/12/22 18:37:33 That's my understanding of Asanka's comments here:
Randy Smith (Not in Mondays) 2014/12/22 18:46:51 Which comment? What I see Asanka saying is "Downl
felt 2014/12/22 18:50:11 "Why is it necessary to invert this? Downloads tha
Randy Smith (Not in Mondays) 2014/12/22 18:55:14 Ah! Thank you. My guess/understanding is that th
asanka 2014/12/23 20:44:11 You guys are reading too much into a caffeine depr
asanka 2014/12/23 20:44:11 You guys are reading too much into a caffeine depr
+ // limiter. However, the DownloadRequestLimiter has its own logic for
+ // determining whether to show a prompt. Setting this to true lets the
+ // DownloadRequestLimiter control the policy and override the user gesture
+ // requirement.
+ // TODO(felt): Investigate whether this policy should be subsumed by an
+ // overall bubble manager policy.
+ return true;
Randy Smith (Not in Mondays) 2014/12/22 18:30:28 So this architecture-smells bad to me, and I'm not
felt 2014/12/22 18:37:33 This also admittedly feels odd to me, but I don't
groby-ooo-7-16 2014/12/22 18:55:39 I think it calls for a "ForceDisplay" API, which w
}
GURL DownloadPermissionRequest::GetRequestingHostname() const {

Powered by Google App Engine
This is Rietveld 408576698