OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
7 #include "chrome/browser/notifications/desktop_notification_service.h" | 7 #include "chrome/browser/notifications/desktop_notification_service.h" |
8 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 8 #include "chrome/browser/notifications/desktop_notification_service_factory.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/notification_ui_manager.h" | 10 #include "chrome/browser/notifications/notification_ui_manager.h" |
11 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" | 11 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" |
12 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" | 12 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac
tory.h" |
13 #include "chrome/browser/notifications/sync_notifier/welcome_delegate.h" | 13 #include "chrome/browser/notifications/sync_notifier/welcome_delegate.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/browser_navigator.h" | 15 #include "chrome/browser/ui/browser_navigator.h" |
16 #include "ui/message_center/message_center.h" | 16 #include "ui/message_center/message_center.h" |
17 #include "ui/message_center/message_center_util.h" | 17 #include "ui/message_center/message_center_util.h" |
18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
19 | 19 |
20 namespace notifier { | 20 namespace notifier { |
21 namespace { | 21 namespace { |
22 void UpdateMessageCenter() { | 22 void UpdateMessageCenter() { |
23 NotificationUIManager* notification_ui_manager = | 23 NotificationUIManager* notification_ui_manager = |
24 g_browser_process->notification_ui_manager(); | 24 g_browser_process->notification_ui_manager(); |
25 if (notification_ui_manager->DelegatesToMessageCenter()) { | 25 MessageCenterNotificationManager* message_center_notification_manager = |
26 MessageCenterNotificationManager* message_center_notification_manager = | 26 static_cast<MessageCenterNotificationManager*>(notification_ui_manager); |
27 static_cast<MessageCenterNotificationManager*>(notification_ui_manager); | |
28 | 27 |
29 message_center_notification_manager->EnsureMessageCenterClosed(); | 28 message_center_notification_manager->EnsureMessageCenterClosed(); |
30 } | |
31 } | 29 } |
32 } // namespace | 30 } // namespace |
33 | 31 |
34 WelcomeDelegate::WelcomeDelegate(const std::string& notification_id, | 32 WelcomeDelegate::WelcomeDelegate(const std::string& notification_id, |
35 Profile* profile, | 33 Profile* profile, |
36 const message_center::NotifierId notifier_id, | 34 const message_center::NotifierId notifier_id, |
37 const GURL& on_click_link) | 35 const GURL& on_click_link) |
38 : notification_id_(notification_id), | 36 : notification_id_(notification_id), |
39 profile_(profile), | 37 profile_(profile), |
40 notifier_id_(notifier_id), | 38 notifier_id_(notifier_id), |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 UpdateMessageCenter(); | 104 UpdateMessageCenter(); |
107 } | 105 } |
108 | 106 |
109 std::string WelcomeDelegate::id() const { return notification_id_; } | 107 std::string WelcomeDelegate::id() const { return notification_id_; } |
110 | 108 |
111 content::RenderViewHost* WelcomeDelegate::GetRenderViewHost() const { | 109 content::RenderViewHost* WelcomeDelegate::GetRenderViewHost() const { |
112 return NULL; | 110 return NULL; |
113 } | 111 } |
114 | 112 |
115 } // namespace notifier | 113 } // namespace notifier |
OLD | NEW |