| 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 "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() { |
| 18 // TODO(dewittj): remove this line when MessageCenterNotificationManager |
| 19 // works. |
| 20 return false; |
| 17 #if defined(ENABLE_MESSAGE_CENTER) | 21 #if defined(ENABLE_MESSAGE_CENTER) |
| 18 return CommandLine::ForCurrentProcess()->HasSwitch( | 22 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 19 switches::kEnableRichNotifications); | 23 switches::kEnableRichNotifications); |
| 20 #else | 24 #else |
| 21 return false; | 25 return false; |
| 22 #endif | 26 #endif |
| 23 } | 27 } |
| 24 | 28 |
| 25 #if !defined(OS_MACOSX) | 29 #if !defined(OS_MACOSX) |
| 26 // static | 30 // static |
| 27 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { | 31 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { |
| 28 #if defined(ENABLE_MESSAGE_CENTER) | 32 #if defined(ENABLE_MESSAGE_CENTER) |
| 29 if (DelegatesToMessageCenter()) | 33 if (DelegatesToMessageCenter()) { |
| 34 chrome::GetMessageCenterTray(); |
| 30 return new MessageCenterNotificationManager(); | 35 return new MessageCenterNotificationManager(); |
| 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 |
| OLD | NEW |