OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/download/download_permission_request.h" | 5 #include "chrome/browser/download/download_permission_request.h" |
6 | 6 |
7 #include "chrome/grit/generated_resources.h" | 7 #include "chrome/grit/generated_resources.h" |
8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 base::string16 DownloadPermissionRequest::GetMessageText() const { | 22 base::string16 DownloadPermissionRequest::GetMessageText() const { |
23 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING); | 23 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING); |
24 } | 24 } |
25 | 25 |
26 base::string16 DownloadPermissionRequest::GetMessageTextFragment() const { | 26 base::string16 DownloadPermissionRequest::GetMessageTextFragment() const { |
27 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_PERMISSION_FRAGMENT); | 27 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_PERMISSION_FRAGMENT); |
28 } | 28 } |
29 | 29 |
30 bool DownloadPermissionRequest::HasUserGesture() const { | 30 bool DownloadPermissionRequest::HasUserGesture() const { |
31 // TODO(gbillock): user gesture for multiple downloads is difficult to | 31 // 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
| |
32 // propagate, and the normal thing is that it is background. | 32 // limiter. However, the DownloadRequestLimiter has its own logic for |
33 return false; | 33 // determining whether to show a prompt. Setting this to true lets the |
34 // DownloadRequestLimiter control the policy and override the user gesture | |
35 // requirement. | |
36 // TODO(felt): Investigate whether this policy should be subsumed by an | |
37 // overall bubble manager policy. | |
38 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
| |
34 } | 39 } |
35 | 40 |
36 GURL DownloadPermissionRequest::GetRequestingHostname() const { | 41 GURL DownloadPermissionRequest::GetRequestingHostname() const { |
37 const content::WebContents* web_contents = host_->web_contents(); | 42 const content::WebContents* web_contents = host_->web_contents(); |
38 if (web_contents) { | 43 if (web_contents) { |
39 return web_contents->GetURL(); | 44 return web_contents->GetURL(); |
40 } | 45 } |
41 return GURL(); | 46 return GURL(); |
42 } | 47 } |
43 | 48 |
(...skipping 12 matching lines...) Expand all Loading... | |
56 } | 61 } |
57 | 62 |
58 void DownloadPermissionRequest::Cancelled() { | 63 void DownloadPermissionRequest::Cancelled() { |
59 // TODO(gbillock): There's currently no suitable method for telling the host | 64 // TODO(gbillock): There's currently no suitable method for telling the host |
60 // that a request is cancelled. | 65 // that a request is cancelled. |
61 } | 66 } |
62 | 67 |
63 void DownloadPermissionRequest::RequestFinished() { | 68 void DownloadPermissionRequest::RequestFinished() { |
64 delete this; | 69 delete this; |
65 } | 70 } |
OLD | NEW |