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

Side by Side 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: Updated DownloadPermissionRequest::HasUserGesture Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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
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 // TODO(felt): Right now, the user gesture is not being used so this value
32 // propagate, and the normal thing is that it is background. 32 // does not matter. The user gesture-related code either needs to be
33 // deprecated, or clients (like DownloadPermissionRequest) with their own
34 // user intent policies need to be able to disable/control the bubble request
35 // visibility & coalescing logic. See crbug.com/446607.
33 return false; 36 return false;
34 } 37 }
35 38
36 GURL DownloadPermissionRequest::GetRequestingHostname() const { 39 GURL DownloadPermissionRequest::GetRequestingHostname() const {
37 const content::WebContents* web_contents = host_->web_contents(); 40 const content::WebContents* web_contents = host_->web_contents();
38 if (web_contents) { 41 if (web_contents) {
39 return web_contents->GetURL(); 42 return web_contents->GetURL();
40 } 43 }
41 return GURL(); 44 return GURL();
42 } 45 }
(...skipping 13 matching lines...) Expand all
56 } 59 }
57 60
58 void DownloadPermissionRequest::Cancelled() { 61 void DownloadPermissionRequest::Cancelled() {
59 // TODO(gbillock): There's currently no suitable method for telling the host 62 // TODO(gbillock): There's currently no suitable method for telling the host
60 // that a request is cancelled. 63 // that a request is cancelled.
61 } 64 }
62 65
63 void DownloadPermissionRequest::RequestFinished() { 66 void DownloadPermissionRequest::RequestFinished() {
64 delete this; 67 delete this;
65 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698