Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: ui/message_center/notification_list.cc

Issue 11778012: Changes the OnClick behavior in message center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/notification_list.h ('k') | ui/message_center/notification_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/notification_list.cc
diff --git a/ui/message_center/notification_list.cc b/ui/message_center/notification_list.cc
index d92051a7ee1510a71dcd22d180636800d94637f7..9425454360f2dae67721690b1b5e10d5a35d791a 100644
--- a/ui/message_center/notification_list.cc
+++ b/ui/message_center/notification_list.cc
@@ -261,6 +261,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;
+
+ // Moves the item to the beginning of the already-shown items.
+ Notification notification = *iter;
+ notification.shown_as_popup = true;
+ 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 re-adding at the end
+ // of the list.
+ notifications_[notification.priority].push_back(notification);
+}
+
void NotificationList::SetQuietMode(bool quiet_mode) {
SetQuietModeInternal(quiet_mode);
quiet_mode_timer_.reset();
« no previous file with comments | « ui/message_center/notification_list.h ('k') | ui/message_center/notification_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698