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

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

Issue 852043002: Initial Implementation of Download Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments & added tests. 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 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 6f8b2199d26197b06f542f3e883d4c7859914d12..bc37acce14340ffb0d73628f179fc1bf8718e3a8 100644
--- a/chrome/browser/download/download_ui_controller.cc
+++ b/chrome/browser/download/download_ui_controller.cc
@@ -5,10 +5,13 @@
#include "chrome/browser/download/download_ui_controller.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "base/stl_util.h"
#include "chrome/browser/download/download_item_model.h"
+#include "chrome/browser/download/notification/download_notification_manager.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/common/chrome_switches.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -101,8 +104,14 @@ DownloadUIController::DownloadUIController(content::DownloadManager* manager,
// The delegate should not be invoked after the profile has gone away. This
// should be the case since DownloadUIController is owned by
// DownloadService, which in turn is a profile keyed service.
- delegate_.reset(new DefaultUIControllerDelegate(
- Profile::FromBrowserContext(manager->GetBrowserContext())));
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableDownloadNotification)) {
+ delegate_.reset(new DownloadNotificationManager(
+ Profile::FromBrowserContext(manager->GetBrowserContext())));
+ } else {
+ delegate_.reset(new DefaultUIControllerDelegate(
asanka 2015/02/20 23:34:39 Shall we rename the UIControllerDelegates? Defaul
yoshiki 2015/02/24 21:30:57 Done.
+ Profile::FromBrowserContext(manager->GetBrowserContext())));
+ }
#endif
}
}

Powered by Google App Engine
This is Rietveld 408576698