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

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

Issue 1704793002: Remove kDisableDownloadNotification and stop compiling shelf code on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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_ui_controller.cc
diff --git a/chrome/browser/download/download_ui_controller.cc b/chrome/browser/download/download_ui_controller.cc
index e0bb05bf48dfffa2fd1a5d3262e4e7e30c74580c..9d7c07e739acbb0d87cbc2bd609be460f8404cc4 100644
--- a/chrome/browser/download/download_ui_controller.cc
+++ b/chrome/browser/download/download_ui_controller.cc
@@ -61,9 +61,7 @@ void AndroidUIControllerDelegate::OnNewDownloadReady(
// InterceptDownloadResourceThrottle::ProcessDownloadRequest().
content::DownloadControllerAndroid::Get()->OnDownloadStarted(item);
}
-
-#else // OS_ANDROID
-
+#elif !defined(OS_CHROMEOS)
class DownloadShelfUIControllerDelegate
: public DownloadUIController::Delegate {
public:
@@ -96,8 +94,7 @@ void DownloadShelfUIControllerDelegate::OnNewDownloadReady(
browser->window()->GetDownloadShelf()->AddDownload(item);
}
}
-
-#endif // !OS_ANDROID
+#endif
} // namespace
@@ -107,23 +104,19 @@ DownloadUIController::Delegate::~Delegate() {
DownloadUIController::DownloadUIController(content::DownloadManager* manager,
scoped_ptr<Delegate> delegate)
: download_notifier_(manager, this), delegate_(std::move(delegate)) {
+ if (!delegate_) {
#if defined(OS_ANDROID)
- if (!delegate_)
delegate_.reset(new AndroidUIControllerDelegate());
-#else
-#if defined(OS_CHROMEOS)
- if (!delegate_ && DownloadNotificationManager::IsEnabled()) {
+#elif defined(OS_CHROMEOS)
// The Profile is guaranteed to be valid since DownloadUIController is owned
// by DownloadService, which in turn is a profile keyed service.
delegate_.reset(new DownloadNotificationManager(
Profile::FromBrowserContext(manager->GetBrowserContext())));
- }
-#endif // defined(OS_CHROMEOS)
- if (!delegate_) {
+#else
delegate_.reset(new DownloadShelfUIControllerDelegate(
Profile::FromBrowserContext(manager->GetBrowserContext())));
+#endif
}
-#endif // defined(OS_ANDROID)
}
DownloadUIController::~DownloadUIController() {
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/notification/download_notification_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698