Chromium Code Reviews| 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 |
| } |
| } |