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

Side by Side Diff: chrome/browser/download/notification/download_notification_manager.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/download/notification/download_notification_manager.h" 5 #include "chrome/browser/download/notification/download_notification_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/download/download_item_model.h" 10 #include "chrome/browser/download/download_item_model.h"
11 #include "chrome/browser/download/notification/download_item_notification.h" 11 #include "chrome/browser/download/notification/download_item_notification.h"
12 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
13 #include "chrome/grit/chromium_strings.h" 13 #include "chrome/grit/chromium_strings.h"
14 #include "content/public/browser/download_item.h" 14 #include "content/public/browser/download_item.h"
15 #include "grit/theme_resources.h" 15 #include "grit/theme_resources.h"
16 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
17 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
18 #include "ui/message_center/message_center.h" 18 #include "ui/message_center/message_center.h"
19 #include "ui/message_center/notification.h" 19 #include "ui/message_center/notification.h"
20 #include "ui/message_center/notification_delegate.h" 20 #include "ui/message_center/notification_delegate.h"
21 21
22 /////////////////////////////////////////////////////////////////////////////// 22 ///////////////////////////////////////////////////////////////////////////////
23 // DownloadNotificationManager implementation: 23 // DownloadNotificationManager implementation:
24 /////////////////////////////////////////////////////////////////////////////// 24 ///////////////////////////////////////////////////////////////////////////////
25 25
26 bool DownloadNotificationManager::IsEnabled() {
27 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
28 switches::kDisableDownloadNotification);
29 }
30
31 DownloadNotificationManager::DownloadNotificationManager(Profile* profile) 26 DownloadNotificationManager::DownloadNotificationManager(Profile* profile)
32 : main_profile_(profile), 27 : main_profile_(profile),
33 items_deleter_(&manager_for_profile_) { 28 items_deleter_(&manager_for_profile_) {
34 } 29 }
35 30
36 DownloadNotificationManager::~DownloadNotificationManager() { 31 DownloadNotificationManager::~DownloadNotificationManager() {
37 } 32 }
38 33
39 void DownloadNotificationManager::OnAllDownloadsRemoving(Profile* profile) { 34 void DownloadNotificationManager::OnAllDownloadsRemoving(Profile* profile) {
40 DownloadNotificationManagerForProfile* manager_for_profile = 35 DownloadNotificationManagerForProfile* manager_for_profile =
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 140
146 DownloadItemNotification* item = new DownloadItemNotification(download, this); 141 DownloadItemNotification* item = new DownloadItemNotification(download, this);
147 items_.insert(std::make_pair(download, item)); 142 items_.insert(std::make_pair(download, item));
148 } 143 }
149 144
150 void DownloadNotificationManagerForProfile::OverrideMessageCenterForTest( 145 void DownloadNotificationManagerForProfile::OverrideMessageCenterForTest(
151 message_center::MessageCenter* message_center) { 146 message_center::MessageCenter* message_center) {
152 DCHECK(message_center); 147 DCHECK(message_center);
153 message_center_ = message_center; 148 message_center_ = message_center;
154 } 149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698