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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual bool HasNotification(const std::string& id) = 0; | 77 virtual bool HasNotification(const std::string& id) = 0; |
78 virtual bool IsQuietMode() const = 0; | 78 virtual bool IsQuietMode() const = 0; |
79 virtual bool HasClickedListener(const std::string& id) = 0; | 79 virtual bool HasClickedListener(const std::string& id) = 0; |
80 | 80 |
81 // Getters of the current notifications. | 81 // Getters of the current notifications. |
82 virtual const NotificationList::Notifications& GetNotifications() = 0; | 82 virtual const NotificationList::Notifications& GetNotifications() = 0; |
83 virtual NotificationList::PopupNotifications GetPopupNotifications() = 0; | 83 virtual NotificationList::PopupNotifications GetPopupNotifications() = 0; |
84 | 84 |
85 // Basic operations of notification: add/remove/update. | 85 // Basic operations of notification: add/remove/update. |
86 | 86 |
87 // Adds a new notification. |id| is a unique identifier, used to update or | 87 // Adds a new notification. |
88 // remove notifications. |title| and |meesage| describe the notification text. | 88 virtual void AddNotification(scoped_ptr<Notification> notification) = 0; |
89 // Use SetNotificationIcon, SetNotificationImage, or SetNotificationButtonIcon | |
90 // to set images. If |extension_id| is provided then 'Disable extension' will | |
91 // appear in a dropdown menu and the id will be used to disable notifications | |
92 // from the extension. Otherwise if |display_source| is provided, a menu item | |
93 // showing the source and allowing notifications from that source to be | |
94 // disabled will be shown. All actual disabling is handled by the Delegate. | |
95 virtual void AddNotification(NotificationType type, | |
96 const std::string& id, | |
97 const string16& title, | |
98 const string16& message, | |
99 const string16& display_source, | |
100 const std::string& extension_id, | |
101 const base::DictionaryValue* optional_fields, | |
102 NotificationDelegate* delegate) = 0; | |
103 | 89 |
104 // Updates an existing notification with id = old_id and set its id to new_id. | 90 // Updates an existing notification with id = old_id and set its id to new_id. |
105 // |delegate| and |optional_fields| can be NULL in case of no updates on | 91 virtual void UpdateNotification( |
106 // those fields. | 92 const std::string& old_id, |
107 virtual void UpdateNotification(const std::string& old_id, | 93 scoped_ptr<Notification> new_notification) = 0; |
108 const std::string& new_id, | |
109 const string16& title, | |
110 const string16& message, | |
111 const base::DictionaryValue* optional_fields, | |
112 NotificationDelegate* delegate) = 0; | |
113 | 94 |
114 // Removes an existing notification. | 95 // Removes an existing notification. |
115 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; | 96 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; |
116 virtual void RemoveAllNotifications(bool by_user) = 0; | 97 virtual void RemoveAllNotifications(bool by_user) = 0; |
117 | 98 |
118 // Sets the icon image. Icon appears at the top-left of the notification. | 99 // Sets the icon image. Icon appears at the top-left of the notification. |
119 virtual void SetNotificationIcon(const std::string& notification_id, | 100 virtual void SetNotificationIcon(const std::string& notification_id, |
120 const gfx::Image& image) = 0; | 101 const gfx::Image& image) = 0; |
121 | 102 |
122 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified | 103 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified |
(...skipping 30 matching lines...) Expand all Loading... |
153 MessageCenter(); | 134 MessageCenter(); |
154 virtual ~MessageCenter(); | 135 virtual ~MessageCenter(); |
155 | 136 |
156 private: | 137 private: |
157 DISALLOW_COPY_AND_ASSIGN(MessageCenter); | 138 DISALLOW_COPY_AND_ASSIGN(MessageCenter); |
158 }; | 139 }; |
159 | 140 |
160 } // namespace message_center | 141 } // namespace message_center |
161 | 142 |
162 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 143 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
OLD | NEW |