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 <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "ui/message_center/message_center_export.h" | 14 #include "ui/message_center/message_center_export.h" |
15 #include "ui/message_center/message_center_types.h" | 15 #include "ui/message_center/message_center_types.h" |
16 #include "ui/message_center/notification_list.h" | 16 #include "ui/message_center/notification_list.h" |
17 | 17 |
18 class DownloadNotification; | 18 class DownloadNotification; |
19 class DownloadNotificationTestBase; | 19 class DownloadNotificationTestBase; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class DictionaryValue; | 22 class DictionaryValue; |
23 } | 23 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // VISIBILITY_TRANSIENT or VISIBILITY_SETTINGS. | 93 // VISIBILITY_TRANSIENT or VISIBILITY_SETTINGS. |
94 virtual NotificationList::PopupNotifications GetPopupNotifications() = 0; | 94 virtual NotificationList::PopupNotifications GetPopupNotifications() = 0; |
95 | 95 |
96 // Management of NotificationBlockers. | 96 // Management of NotificationBlockers. |
97 virtual void AddNotificationBlocker(NotificationBlocker* blocker) = 0; | 97 virtual void AddNotificationBlocker(NotificationBlocker* blocker) = 0; |
98 virtual void RemoveNotificationBlocker(NotificationBlocker* blocker) = 0; | 98 virtual void RemoveNotificationBlocker(NotificationBlocker* blocker) = 0; |
99 | 99 |
100 // Basic operations of notification: add/remove/update. | 100 // Basic operations of notification: add/remove/update. |
101 | 101 |
102 // Adds a new notification. | 102 // Adds a new notification. |
103 virtual void AddNotification(scoped_ptr<Notification> notification) = 0; | 103 virtual void AddNotification(std::unique_ptr<Notification> notification) = 0; |
104 | 104 |
105 // Updates an existing notification with id = old_id and set its id to new_id. | 105 // Updates an existing notification with id = old_id and set its id to new_id. |
106 virtual void UpdateNotification( | 106 virtual void UpdateNotification( |
107 const std::string& old_id, | 107 const std::string& old_id, |
108 scoped_ptr<Notification> new_notification) = 0; | 108 std::unique_ptr<Notification> new_notification) = 0; |
109 | 109 |
110 // Removes an existing notification. | 110 // Removes an existing notification. |
111 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; | 111 virtual void RemoveNotification(const std::string& id, bool by_user) = 0; |
112 virtual void RemoveAllNotifications(bool by_user, RemoveType type) = 0; | 112 virtual void RemoveAllNotifications(bool by_user, RemoveType type) = 0; |
113 | 113 |
114 // Sets the icon image. Icon appears at the top-left of the notification. | 114 // Sets the icon image. Icon appears at the top-left of the notification. |
115 virtual void SetNotificationIcon(const std::string& notification_id, | 115 virtual void SetNotificationIcon(const std::string& notification_id, |
116 const gfx::Image& image) = 0; | 116 const gfx::Image& image) = 0; |
117 | 117 |
118 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified | 118 // Sets the large image for the notifications of type == TYPE_IMAGE. Specified |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // Note carefully: this may break the layout of message center. Shouldn't use | 211 // Note carefully: this may break the layout of message center. Shouldn't use |
212 // this method if the update changes its notification size. | 212 // this method if the update changes its notification size. |
213 virtual void ForceNotificationFlush(const std::string& id) {} | 213 virtual void ForceNotificationFlush(const std::string& id) {} |
214 | 214 |
215 DISALLOW_COPY_AND_ASSIGN(MessageCenter); | 215 DISALLOW_COPY_AND_ASSIGN(MessageCenter); |
216 }; | 216 }; |
217 | 217 |
218 } // namespace message_center | 218 } // namespace message_center |
219 | 219 |
220 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ | 220 #endif // UI_MESSAGE_CENTER_MESSAGE_CENTER_H_ |
OLD | NEW |