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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 message_center::MessageCenter* message_center, | 45 message_center::MessageCenter* message_center, |
46 PrefService* local_state, | 46 PrefService* local_state, |
47 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider); | 47 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider); |
48 virtual ~MessageCenterNotificationManager(); | 48 virtual ~MessageCenterNotificationManager(); |
49 | 49 |
50 // Registers preferences. | 50 // Registers preferences. |
51 static void RegisterPrefs(PrefRegistrySimple* registry); | 51 static void RegisterPrefs(PrefRegistrySimple* registry); |
52 | 52 |
53 // NotificationUIManager | 53 // NotificationUIManager |
54 virtual void Add(const Notification& notification, | 54 virtual void Add(const Notification& notification, |
55 Profile* profile) OVERRIDE; | 55 Profile* profile) override; |
56 virtual bool Update(const Notification& notification, | 56 virtual bool Update(const Notification& notification, |
57 Profile* profile) OVERRIDE; | 57 Profile* profile) override; |
58 virtual const Notification* FindById(const std::string& delegate_id, | 58 virtual const Notification* FindById(const std::string& delegate_id, |
59 ProfileID profile_id) const OVERRIDE; | 59 ProfileID profile_id) const override; |
60 virtual bool CancelById(const std::string& delegate_id, | 60 virtual bool CancelById(const std::string& delegate_id, |
61 ProfileID profile_id) OVERRIDE; | 61 ProfileID profile_id) override; |
62 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( | 62 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
63 Profile* profile, | 63 Profile* profile, |
64 const GURL& source) OVERRIDE; | 64 const GURL& source) override; |
65 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; | 65 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) override; |
66 virtual bool CancelAllByProfile(ProfileID profile_id) OVERRIDE; | 66 virtual bool CancelAllByProfile(ProfileID profile_id) override; |
67 virtual void CancelAll() OVERRIDE; | 67 virtual void CancelAll() override; |
68 | 68 |
69 // MessageCenterObserver | 69 // MessageCenterObserver |
70 virtual void OnNotificationRemoved(const std::string& notification_id, | 70 virtual void OnNotificationRemoved(const std::string& notification_id, |
71 bool by_user) OVERRIDE; | 71 bool by_user) override; |
72 virtual void OnCenterVisibilityChanged(message_center::Visibility) OVERRIDE; | 72 virtual void OnCenterVisibilityChanged(message_center::Visibility) override; |
73 virtual void OnNotificationUpdated(const std::string& notification_id) | 73 virtual void OnNotificationUpdated(const std::string& notification_id) |
74 OVERRIDE; | 74 override; |
75 | 75 |
76 void EnsureMessageCenterClosed(); | 76 void EnsureMessageCenterClosed(); |
77 | 77 |
78 #if defined(OS_WIN) | 78 #if defined(OS_WIN) |
79 // Called when the pref changes for the first run balloon. The first run | 79 // Called when the pref changes for the first run balloon. The first run |
80 // balloon is only displayed on Windows, since the visibility of the tray | 80 // balloon is only displayed on Windows, since the visibility of the tray |
81 // icon is limited. | 81 // icon is limited. |
82 void DisplayFirstRunBalloon(); | 82 void DisplayFirstRunBalloon(); |
83 | 83 |
84 void SetFirstRunTimeoutForTest(base::TimeDelta timeout); | 84 void SetFirstRunTimeoutForTest(base::TimeDelta timeout); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 class ProfileNotification : public ImageDownloadsObserver { | 162 class ProfileNotification : public ImageDownloadsObserver { |
163 public: | 163 public: |
164 ProfileNotification(Profile* profile, | 164 ProfileNotification(Profile* profile, |
165 const Notification& notification, | 165 const Notification& notification, |
166 message_center::MessageCenter* message_center); | 166 message_center::MessageCenter* message_center); |
167 virtual ~ProfileNotification(); | 167 virtual ~ProfileNotification(); |
168 | 168 |
169 void StartDownloads(); | 169 void StartDownloads(); |
170 | 170 |
171 // Overridden from ImageDownloadsObserver. | 171 // Overridden from ImageDownloadsObserver. |
172 virtual void OnDownloadsCompleted() OVERRIDE; | 172 virtual void OnDownloadsCompleted() override; |
173 | 173 |
174 Profile* profile() const { return profile_; } | 174 Profile* profile() const { return profile_; } |
175 const Notification& notification() const { return notification_; } | 175 const Notification& notification() const { return notification_; } |
176 | 176 |
177 // Route a new notification to an app/extension. | 177 // Route a new notification to an app/extension. |
178 void AddToAlternateProvider(const std::string extension_id); | 178 void AddToAlternateProvider(const std::string extension_id); |
179 | 179 |
180 private: | 180 private: |
181 // Weak, guaranteed not to be used after profile removal by parent class. | 181 // Weak, guaranteed not to be used after profile removal by parent class. |
182 Profile* profile_; | 182 Profile* profile_; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // Keeps track of all notification statistics for UMA purposes. | 238 // Keeps track of all notification statistics for UMA purposes. |
239 MessageCenterStatsCollector stats_collector_; | 239 MessageCenterStatsCollector stats_collector_; |
240 | 240 |
241 // Keeps track of notifications specific to Google Now for UMA purposes. | 241 // Keeps track of notifications specific to Google Now for UMA purposes. |
242 GoogleNowNotificationStatsCollector google_now_stats_collector_; | 242 GoogleNowNotificationStatsCollector google_now_stats_collector_; |
243 | 243 |
244 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); | 244 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); |
245 }; | 245 }; |
246 | 246 |
247 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 247 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
OLD | NEW |