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

Side by Side Diff: chrome/browser/notifications/notification_ui_manager.cc

Issue 231723006: Remove balloon notification code. The last user was the Linux GTK port but that's deleted now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync after elliot's r263101 Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/notifications/notification_ui_manager.h" 5 #include "chrome/browser/notifications/notification_ui_manager.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/notifications/message_center_notification_manager.h" 9 #include "chrome/browser/notifications/message_center_notification_manager.h"
10 #include "chrome/browser/notifications/message_center_settings_controller.h" 10 #include "chrome/browser/notifications/message_center_settings_controller.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/profiles/profile_info_cache.h" 12 #include "chrome/browser/profiles/profile_info_cache.h"
13 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
14 #include "ui/message_center/message_center_util.h" 14 #include "ui/message_center/message_center_util.h"
15 15
16 #if !defined(OS_CHROMEOS)
17 #include "chrome/browser/notifications/balloon_notification_ui_manager.h"
18 #endif
19
20 // static
21 bool NotificationUIManager::DelegatesToMessageCenter() {
22 // In ChromeOS, it always uses MessageCenterNotificationManager. The flag of
23 // --enable-rich-notifications switches the contents and behaviors inside of
24 // the message center.
25 #if defined(OS_CHROMEOS)
26 return true;
27 #endif
28 return message_center::IsRichNotificationEnabled();
29 }
30
31 // static 16 // static
32 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { 17 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) {
33 if (DelegatesToMessageCenter()) { 18 ProfileInfoCache* profile_info_cache =
34 ProfileInfoCache* profile_info_cache = 19 &g_browser_process->profile_manager()->GetProfileInfoCache();
35 &g_browser_process->profile_manager()->GetProfileInfoCache(); 20 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider(
36 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider( 21 new MessageCenterSettingsController(profile_info_cache));
37 new MessageCenterSettingsController(profile_info_cache)); 22 return new MessageCenterNotificationManager(
38 return new MessageCenterNotificationManager( 23 g_browser_process->message_center(),
39 g_browser_process->message_center(), 24 local_state,
40 local_state, 25 settings_provider.Pass());
41 settings_provider.Pass());
42 }
43
44 #if defined(TOOLKIT_GTK)
45 BalloonNotificationUIManager* balloon_manager =
46 new BalloonNotificationUIManager(local_state);
47 balloon_manager->SetBalloonCollection(BalloonCollection::Create());
48 return balloon_manager;
49 #else
50 CHECK(false);
51 return NULL;
52 #endif
53 } 26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698