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 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... | |
25 class PrefService; | 25 class PrefService; |
26 class Profile; | 26 class Profile; |
27 | 27 |
28 // This class extends NotificationUIManagerImpl and delegates actual display | 28 // This class extends NotificationUIManagerImpl and delegates actual display |
29 // of notifications to MessageCenter, doing necessary conversions. | 29 // of notifications to MessageCenter, doing necessary conversions. |
30 class MessageCenterNotificationManager | 30 class MessageCenterNotificationManager |
31 : public NotificationUIManagerImpl, | 31 : public NotificationUIManagerImpl, |
32 public message_center::MessageCenter::Delegate, | 32 public message_center::MessageCenter::Delegate, |
33 public message_center::MessageCenterObserver { | 33 public message_center::MessageCenterObserver { |
34 public: | 34 public: |
35 explicit MessageCenterNotificationManager( | 35 MessageCenterNotificationManager( |
36 message_center::MessageCenter* message_center, | 36 message_center::MessageCenter* message_center, |
37 PrefService* local_state); | 37 PrefService* local_state, |
38 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider); | |
38 virtual ~MessageCenterNotificationManager(); | 39 virtual ~MessageCenterNotificationManager(); |
39 | 40 |
40 // NotificationUIManager | 41 // NotificationUIManager |
41 virtual const Notification* FindById( | 42 virtual const Notification* FindById( |
42 const std::string& notification_id) const OVERRIDE; | 43 const std::string& notification_id) const OVERRIDE; |
43 virtual bool CancelById(const std::string& notification_id) OVERRIDE; | 44 virtual bool CancelById(const std::string& notification_id) OVERRIDE; |
44 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( | 45 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
45 Profile* profile, | 46 Profile* profile, |
46 const GURL& source) OVERRIDE; | 47 const GURL& source) OVERRIDE; |
47 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; | 48 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 base::OneShotTimer<MessageCenterNotificationManager> first_run_balloon_timer_; | 206 base::OneShotTimer<MessageCenterNotificationManager> first_run_balloon_timer_; |
206 | 207 |
207 // The first-run balloon will be shown |first_run_idle_timeout_| after all | 208 // The first-run balloon will be shown |first_run_idle_timeout_| after all |
208 // popups go away and the user has notifications in the message center. | 209 // popups go away and the user has notifications in the message center. |
209 base::TimeDelta first_run_idle_timeout_; | 210 base::TimeDelta first_run_idle_timeout_; |
210 | 211 |
211 // Provides weak pointers for the purpose of the first run timer. | 212 // Provides weak pointers for the purpose of the first run timer. |
212 base::WeakPtrFactory<MessageCenterNotificationManager> weak_factory_; | 213 base::WeakPtrFactory<MessageCenterNotificationManager> weak_factory_; |
213 #endif | 214 #endif |
214 | 215 |
215 scoped_ptr<MessageCenterSettingsController> settings_controller_; | 216 scoped_ptr<message_center::NotifierSettingsProvider> settings_controller_; |
jianli
2013/08/05 20:48:03
Should we rename settings_controller_ to settings
dewittj
2013/08/05 22:42:28
Done.
| |
216 | 217 |
217 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); | 218 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); |
218 }; | 219 }; |
219 | 220 |
220 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 221 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
OLD | NEW |