Chromium Code Reviews| Index: ui/message_center/notification_list.cc |
| diff --git a/ui/message_center/notification_list.cc b/ui/message_center/notification_list.cc |
| index 4add984f2e078a643c6cfa06f1538898af561396..422983368884197d90707b6899cc7c0c198ad9e9 100644 |
| --- a/ui/message_center/notification_list.cc |
| +++ b/ui/message_center/notification_list.cc |
| @@ -252,6 +252,32 @@ void NotificationList::MarkPopupsAsShown(int priority) { |
| iter->shown_as_popup = true; |
| } |
| +void NotificationList::MarkSinglePopupAsShown(const std::string& id) { |
| + Notifications::iterator iter; |
| + if (!GetNotification(id, &iter)) |
| + return; |
| + |
| + if (iter->shown_as_popup) |
| + return; |
| + |
| + Notification notification = *iter; |
| + notification.shown_as_popup = true; |
| + // Moves the item at the beginning of the read items. |
|
miket_OOO
2013/01/07 22:29:07
This comment would make more sense before line 263
Jun Mukai
2013/01/08 02:13:11
Done.
|
| + notifications_[notification.priority].erase(iter); |
| + for (Notifications::iterator iter2 = |
| + notifications_[notification.priority].begin(); |
| + iter2 != notifications_[notification.priority].end(); iter2++) { |
| + if (iter2->shown_as_popup) { |
| + notifications_[notification.priority].insert(iter2, notification); |
| + return; |
| + } |
| + } |
| + |
| + // No notifications are already shown as popup, so just adding at the end of |
|
miket_OOO
2013/01/07 22:29:07
"re-adding" or "adding back" is a bit clearer than
Jun Mukai
2013/01/08 02:13:11
Done.
|
| + // the list. |
| + notifications_[notification.priority].push_back(notification); |
| +} |
| + |
| void NotificationList::SetQuietMode(bool quiet_mode) { |
| SetQuietModeInternal(quiet_mode); |
| quiet_mode_timer_.reset(); |