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 UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 5 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 class MessagePopupCollectionTest; | 43 class MessagePopupCollectionTest; |
44 } | 44 } |
45 | 45 |
46 class MessageCenterObserver; | 46 class MessageCenterObserver; |
47 class MessageCenterImplTest; | 47 class MessageCenterImplTest; |
48 class NotificationBlocker; | 48 class NotificationBlocker; |
49 class NotifierSettingsProvider; | 49 class NotifierSettingsProvider; |
50 | 50 |
51 class MESSAGE_CENTER_EXPORT MessageCenter { | 51 class MESSAGE_CENTER_EXPORT MessageCenter { |
52 public: | 52 public: |
53 enum class RemoveType { | |
54 // Remove all notifications (including invisible ones and unclosable ones). | |
dewittj
2016/02/08 18:02:34
nit: remove the parenthetical phrase - I think |al
yoshiki
2016/02/09 23:42:25
Done.
| |
55 ALL, | |
56 // Remove visible notifications including unclosable ones. | |
57 VISIBLE, | |
dewittj
2016/02/08 18:02:34
This flag is only used in a test, why don't we jus
yoshiki
2016/02/09 23:42:25
Removed. Done.
| |
58 // Remove closable notification (doesn't remove invisible ones). | |
59 CLOSABLE, | |
dewittj
2016/02/08 18:02:34
These flag names are still confusing. I don't hav
yoshiki
2016/02/09 23:42:25
Thank you for suggestion! Renamed this to "pinned"
| |
60 }; | |
61 | |
53 // Creates the global message center object. | 62 // Creates the global message center object. |
54 static void Initialize(); | 63 static void Initialize(); |
55 | 64 |
56 // Returns the global message center object. Returns NULL if Initialize is not | 65 // Returns the global message center object. Returns NULL if Initialize is not |
57 // called. | 66 // called. |
58 static MessageCenter* Get(); | 67 static MessageCenter* Get(); |
59 | 68 |
60 // Destroys the global message_center object. | 69 // Destroys the global message_center object. |
61 static void Shutdown(); | 70 static void Shutdown(); |
62 | 71 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 // Adds a new notification. | 104 // Adds a new notification. |
96 virtual void AddNotification(scoped_ptr<Notification> notification) = 0; | 105 virtual void AddNotification(scoped_ptr<Notification> notification) = 0; |
97 | 106 |
98 // Updates an existing notification with id = old_id and set its id to new_id. | 107 // Updates an existing notification with id = old_id and set its id to new_id. |
99 virtual void UpdateNotification( | 108 virtual void UpdateNotification( |
100 const std::string& old_id, | 109 const std::string& old_id, |
101 scoped_ptr<Notification> new_notification) = 0; | 110 scoped_ptr<Notification> new_notification) = 0; |
102 | 111 |
103 // Removes an existing notification. | 112 // Removes an existing notification. |
104 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; | 113 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; |
105 virtual void RemoveAllNotifications(bool by_user) = 0; | 114 virtual void RemoveAllNotifications(bool by_user, RemoveType type) = 0; |
106 virtual void RemoveAllVisibleNotifications(bool by_user) = 0; | |
107 | 115 |
108 // Sets the icon image. Icon appears at the top-left of the notification. | 116 // Sets the icon image. Icon appears at the top-left of the notification. |
109 virtual void SetNotificationIcon(const std::string& notification_id, | 117 virtual void SetNotificationIcon(const std::string& notification_id, |
110 const gfx::Image& image) = 0; | 118 const gfx::Image& image) = 0; |
111 | 119 |
112 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified | 120 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified |
113 // image will appear below of the notification. | 121 // image will appear below of the notification. |
114 virtual void SetNotificationImage(const std::string& notification_id, | 122 virtual void SetNotificationImage(const std::string& notification_id, |
115 const gfx::Image& image) = 0; | 123 const gfx::Image& image) = 0; |
116 | 124 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 // Note carefully: this may break the layout of message center. Shouldn't use | 213 // Note carefully: this may break the layout of message center. Shouldn't use |
206 // this method if the update changes its notification size. | 214 // this method if the update changes its notification size. |
207 virtual void ForceNotificationFlush(const std::string& id) {} | 215 virtual void ForceNotificationFlush(const std::string& id) {} |
208 | 216 |
209 DISALLOW_COPY_AND_ASSIGN(MessageCenter); | 217 DISALLOW_COPY_AND_ASSIGN(MessageCenter); |
210 }; | 218 }; |
211 | 219 |
212 } // namespace message_center | 220 } // namespace message_center |
213 | 221 |
214 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 222 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
OLD | NEW |