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

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

Issue 176053002: [WebsiteSettings] Change permission bubble API to adapt to new mocks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add multi-download bubble changes. Created 6 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 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 b6711141733d2ac71770c0be402fe0d2beb0ca4a..18e19959337d86d03d0a7b0f729395e642298789 100644
--- a/chrome/browser/download/download_permission_request.cc
+++ b/chrome/browser/download/download_permission_request.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/download/download_permission_request.h"
+#include "content/public/browser/web_contents.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -14,6 +15,10 @@ DownloadPermissionRequest::DownloadPermissionRequest(
DownloadPermissionRequest::~DownloadPermissionRequest() {}
+int DownloadPermissionRequest::GetIconID() const {
+ return IDR_INFOBAR_MULTIPLE_DOWNLOADS;
+}
+
base::string16 DownloadPermissionRequest::GetMessageText() const {
return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING);
}
@@ -22,12 +27,18 @@ base::string16 DownloadPermissionRequest::GetMessageTextFragment() const {
return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_PERMISSION_FRAGMENT);
}
-base::string16 DownloadPermissionRequest::GetAlternateAcceptButtonText() const {
- return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING_ALLOW);
+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;
}
-base::string16 DownloadPermissionRequest::GetAlternateDenyButtonText() const {
- return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING_DENY);
+GURL DownloadPermissionRequest::GetRequestingHostname() const {
+ const content::WebContents* web_contents = host_->web_contents();
+ if (web_contents) {
+ return web_contents->GetURL();
+ }
+ return GURL();
}
void DownloadPermissionRequest::PermissionGranted() {

Powered by Google App Engine
This is Rietveld 408576698