| 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_NOTIFICATION_LIST_H_ | 5 #ifndef UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ |
| 6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ | 6 #define UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 explicit NotificationList(); | 59 explicit NotificationList(); |
| 60 virtual ~NotificationList(); | 60 virtual ~NotificationList(); |
| 61 | 61 |
| 62 // Affects whether or not a message has been "read". Collects the set of | 62 // Affects whether or not a message has been "read". Collects the set of |
| 63 // ids whose state have changed and set to |udpated_ids|. NULL if updated | 63 // ids whose state have changed and set to |udpated_ids|. NULL if updated |
| 64 // ids don't matter. | 64 // ids don't matter. |
| 65 void SetMessageCenterVisible(bool visible, | 65 void SetMessageCenterVisible(bool visible, |
| 66 std::set<std::string>* updated_ids); | 66 std::set<std::string>* updated_ids); |
| 67 | 67 |
| 68 void AddNotification(scoped_ptr<Notification> notification); | 68 void AddNotification(std::unique_ptr<Notification> notification); |
| 69 | 69 |
| 70 void UpdateNotificationMessage(const std::string& old_id, | 70 void UpdateNotificationMessage( |
| 71 scoped_ptr<Notification> new_notification); | 71 const std::string& old_id, |
| 72 std::unique_ptr<Notification> new_notification); |
| 72 | 73 |
| 73 void RemoveNotification(const std::string& id); | 74 void RemoveNotification(const std::string& id); |
| 74 | 75 |
| 75 Notifications GetNotificationsByNotifierId(const NotifierId& notifier_id); | 76 Notifications GetNotificationsByNotifierId(const NotifierId& notifier_id); |
| 76 | 77 |
| 77 // Returns true if the notification exists and was updated. | 78 // Returns true if the notification exists and was updated. |
| 78 bool SetNotificationIcon(const std::string& notification_id, | 79 bool SetNotificationIcon(const std::string& notification_id, |
| 79 const gfx::Image& image); | 80 const gfx::Image& image); |
| 80 | 81 |
| 81 // Returns true if the notification exists and was updated. | 82 // Returns true if the notification exists and was updated. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 private: | 142 private: |
| 142 friend class NotificationListTest; | 143 friend class NotificationListTest; |
| 143 FRIEND_TEST_ALL_PREFIXES(NotificationListTest, | 144 FRIEND_TEST_ALL_PREFIXES(NotificationListTest, |
| 144 TestPushingShownNotification); | 145 TestPushingShownNotification); |
| 145 | 146 |
| 146 // Iterates through the list and returns the first notification matching |id|. | 147 // Iterates through the list and returns the first notification matching |id|. |
| 147 Notifications::iterator GetNotification(const std::string& id); | 148 Notifications::iterator GetNotification(const std::string& id); |
| 148 | 149 |
| 149 void EraseNotification(Notifications::iterator iter); | 150 void EraseNotification(Notifications::iterator iter); |
| 150 | 151 |
| 151 void PushNotification(scoped_ptr<Notification> notification); | 152 void PushNotification(std::unique_ptr<Notification> notification); |
| 152 | 153 |
| 153 Notifications notifications_; | 154 Notifications notifications_; |
| 154 bool message_center_visible_; | 155 bool message_center_visible_; |
| 155 bool quiet_mode_; | 156 bool quiet_mode_; |
| 156 | 157 |
| 157 DISALLOW_COPY_AND_ASSIGN(NotificationList); | 158 DISALLOW_COPY_AND_ASSIGN(NotificationList); |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 } // namespace message_center | 161 } // namespace message_center |
| 161 | 162 |
| 162 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ | 163 #endif // UI_MESSAGE_CENTER_NOTIFICATION_LIST_H_ |
| OLD | NEW |