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

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

Issue 11819048: Implement message center on Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Now with more tests, and corrected copyright notices. Created 7 years, 11 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 (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/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" 8 #include "chrome/browser/notifications/balloon_notification_ui_manager.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 10
11 #if defined(ENABLE_MESSAGE_CENTER) 11 #if defined(ENABLE_MESSAGE_CENTER)
12 #include "chrome/browser/notifications/message_center_notification_manager.h" 12 #include "chrome/browser/notifications/message_center_notification_manager.h"
13 #include "chrome/browser/ui/message_center/message_center_util.h"
13 #endif 14 #endif
14 15
15 // static 16 // static
16 bool NotificationUIManager::DelegatesToMessageCenter() { 17 bool NotificationUIManager::DelegatesToMessageCenter() {
17 #if defined(ENABLE_MESSAGE_CENTER) 18 #if defined(ENABLE_MESSAGE_CENTER)
18 return CommandLine::ForCurrentProcess()->HasSwitch( 19 return CommandLine::ForCurrentProcess()->HasSwitch(
19 switches::kEnableRichNotifications); 20 switches::kEnableRichNotifications);
20 #else 21 #else
21 return false; 22 return false;
22 #endif 23 #endif
23 } 24 }
24 25
25 #if !defined(OS_MACOSX) 26 #if !defined(OS_MACOSX)
26 // static 27 // static
27 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { 28 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) {
28 #if defined(ENABLE_MESSAGE_CENTER) 29 #if defined(ENABLE_MESSAGE_CENTER)
29 if (DelegatesToMessageCenter()) 30 if (DelegatesToMessageCenter()) {
30 return new MessageCenterNotificationManager(); 31 // Instantiates the singleton message center tray object.
32 chrome::GetMessageCenterTray();
33 // TODO(dewittj): Enable this when MessageCenterNotificationManager does
34 // something.
35 // return new MessageCenterNotificationManager();
Pete Williamson 2013/01/23 19:52:16 Generally we don't check in commented out code, ev
dewittj 2013/01/23 22:07:51 This has been fixed in later patchsets.
36 }
31 #endif 37 #endif
32 BalloonNotificationUIManager* balloon_manager = 38 BalloonNotificationUIManager* balloon_manager =
33 new BalloonNotificationUIManager(local_state); 39 new BalloonNotificationUIManager(local_state);
34 balloon_manager->SetBalloonCollection(BalloonCollection::Create()); 40 balloon_manager->SetBalloonCollection(BalloonCollection::Create());
35 return balloon_manager; 41 return balloon_manager;
36 } 42 }
37 #endif 43 #endif
38 44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698