| 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() {
|
|
|