OLD | NEW |
---|---|
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 "ui/message_center/message_center_switches.h" |
Dmitry Titov
2013/01/26 02:54:50
#if defined(ENABLE_MESSAGE_CENTER) needed.
dharcourt
2013/01/26 04:07:04
Done.
| |
10 | 10 |
11 #if defined(ENABLE_MESSAGE_CENTER) | 11 #if defined(ENABLE_MESSAGE_CENTER) |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/notifications/message_center_notification_manager.h" | 13 #include "chrome/browser/notifications/message_center_notification_manager.h" |
14 #endif | 14 #endif |
15 | 15 |
16 // static | 16 // static |
17 bool NotificationUIManager::DelegatesToMessageCenter() { | 17 bool NotificationUIManager::DelegatesToMessageCenter() { |
18 return CommandLine::ForCurrentProcess()->HasSwitch( | 18 return CommandLine::ForCurrentProcess()->HasSwitch( |
19 switches::kEnableRichNotifications); | 19 message_center::switches::kEnableRichNotifications); |
Dmitry Titov
2013/01/26 02:54:50
Ditto here.
dharcourt
2013/01/26 04:07:04
Done.
| |
20 return false; | 20 return false; |
21 } | 21 } |
22 | 22 |
23 #if !defined(OS_MACOSX) | 23 #if !defined(OS_MACOSX) |
24 // static | 24 // static |
25 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { | 25 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { |
26 #if defined(ENABLE_MESSAGE_CENTER) | 26 #if defined(ENABLE_MESSAGE_CENTER) |
27 if (DelegatesToMessageCenter()) | 27 if (DelegatesToMessageCenter()) |
28 return new MessageCenterNotificationManager( | 28 return new MessageCenterNotificationManager( |
29 g_browser_process->message_center()); | 29 g_browser_process->message_center()); |
30 #endif | 30 #endif |
31 BalloonNotificationUIManager* balloon_manager = | 31 BalloonNotificationUIManager* balloon_manager = |
32 new BalloonNotificationUIManager(local_state); | 32 new BalloonNotificationUIManager(local_state); |
33 balloon_manager->SetBalloonCollection(BalloonCollection::Create()); | 33 balloon_manager->SetBalloonCollection(BalloonCollection::Create()); |
34 return balloon_manager; | 34 return balloon_manager; |
35 } | 35 } |
36 #endif | 36 #endif |
37 | 37 |
OLD | NEW |