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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 scoped_ptr<message_center::MessageCenterTrayDelegate> tray_; | 185 scoped_ptr<message_center::MessageCenterTrayDelegate> tray_; |
186 message_center::MessageCenter* message_center_; // Weak, global. | 186 message_center::MessageCenter* message_center_; // Weak, global. |
187 | 187 |
188 // Use a map by notification_id since this mapping is the most often used. | 188 // Use a map by notification_id since this mapping is the most often used. |
189 typedef std::map<std::string, ProfileNotification*> NotificationMap; | 189 typedef std::map<std::string, ProfileNotification*> NotificationMap; |
190 NotificationMap profile_notifications_; | 190 NotificationMap profile_notifications_; |
191 | 191 |
192 // Helpers that add/remove the notification from local map and MessageCenter. | 192 // Helpers that add/remove the notification from local map and MessageCenter. |
193 // They take ownership of profile_notification object. | 193 // They take ownership of profile_notification object. |
194 void AddProfileNotification(ProfileNotification* profile_notification); | 194 void AddProfileNotification(ProfileNotification* profile_notification); |
195 void RemoveProfileNotification(ProfileNotification* profile_notification, | 195 void RemoveProfileNotification(ProfileNotification* profile_notification); |
196 bool by_user); | |
197 | 196 |
198 // Returns the ProfileNotification for the |id|, or NULL if no such | 197 // Returns the ProfileNotification for the |id|, or NULL if no such |
199 // notification is found. | 198 // notification is found. |
200 ProfileNotification* FindProfileNotification(const std::string& id) const; | 199 ProfileNotification* FindProfileNotification(const std::string& id) const; |
201 | 200 |
202 #if defined(OS_WIN) | 201 #if defined(OS_WIN) |
203 // This function is run on update to ensure that the notification balloon is | 202 // This function is run on update to ensure that the notification balloon is |
204 // shown only when there are no popups present. | 203 // shown only when there are no popups present. |
205 void CheckFirstRunTimer(); | 204 void CheckFirstRunTimer(); |
206 | 205 |
(...skipping 16 matching lines...) Expand all Loading... |
223 | 222 |
224 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider_; | 223 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider_; |
225 | 224 |
226 // Registrar for the other kind of notifications (event signaling). | 225 // Registrar for the other kind of notifications (event signaling). |
227 content::NotificationRegistrar registrar_; | 226 content::NotificationRegistrar registrar_; |
228 | 227 |
229 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); | 228 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); |
230 }; | 229 }; |
231 | 230 |
232 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 231 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
OLD | NEW |