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

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

Issue 1322033003: Stop compiling dead download infobar code on desktop Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gn Created 5 years, 4 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_request_limiter.cc
diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc
index 532f525086eaad74a168d2a3eee6408c2544d2a6..be62ebf1ec948168361245f6110112d7e9a6b55e 100644
--- a/chrome/browser/download/download_request_limiter.cc
+++ b/chrome/browser/download/download_request_limiter.cc
@@ -8,7 +8,6 @@
#include "base/stl_util.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/download/download_permission_request.h"
-#include "chrome/browser/download/download_request_infobar_delegate.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_util.h"
@@ -26,6 +25,10 @@
#include "content/public/browser/web_contents_delegate.h"
#include "url/gurl.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/download/download_request_infobar_delegate.h"
+#endif
+
using content::BrowserThread;
using content::NavigationController;
using content::NavigationEntry;
@@ -127,20 +130,19 @@ void DownloadRequestLimiter::TabDownloadState::PromptUserForDownload(
if (is_showing_prompt())
return;
- if (PermissionBubbleManager::Enabled()) {
- PermissionBubbleManager* bubble_manager =
- PermissionBubbleManager::FromWebContents(web_contents_);
- if (bubble_manager) {
- bubble_manager->AddRequest(new DownloadPermissionRequest(
- factory_.GetWeakPtr()));
- } else {
- Cancel();
- }
- return;
- }
-
+#if defined(OS_ANDROID)
DownloadRequestInfoBarDelegate::Create(
InfoBarService::FromWebContents(web_contents_), factory_.GetWeakPtr());
+#else
+ PermissionBubbleManager* bubble_manager =
+ PermissionBubbleManager::FromWebContents(web_contents_);
+ if (bubble_manager) {
+ bubble_manager->AddRequest(new DownloadPermissionRequest(
+ factory_.GetWeakPtr()));
+ } else {
+ Cancel();
+ }
+#endif
}
void DownloadRequestLimiter::TabDownloadState::SetContentSetting(
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_request_limiter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698