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

Unified Diff: ui/message_center/notification_list.cc

Issue 14299007: Sends Updated when message center is closed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 8 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 8634394bd79e233de8f83e2e9d26d0ea63c68856..7adfcfb879ab1b7132c02e11e6710c6e533b8ba9 100644
--- a/ui/message_center/notification_list.cc
+++ b/ui/message_center/notification_list.cc
@@ -48,9 +48,12 @@ NotificationList::~NotificationList() {
STLDeleteContainerPointers(notifications_.begin(), notifications_.end());
}
-void NotificationList::SetMessageCenterVisible(bool visible) {
+void NotificationList::SetMessageCenterVisible(
+ bool visible,
+ std::set<std::string>* updated_ids) {
if (message_center_visible_ == visible)
return;
+
message_center_visible_ = visible;
// When the center appears, mark all notifications as shown, and
// when the center is hidden, clear the unread count, and mark all
@@ -60,10 +63,15 @@ void NotificationList::SetMessageCenterVisible(bool visible) {
for (Notifications::iterator iter = notifications_.begin();
iter != notifications_.end(); ++iter) {
- if (visible)
+ if (visible) {
+ if (updated_ids && !(*iter)->shown_as_popup())
+ updated_ids->insert((*iter)->id());
(*iter)->set_shown_as_popup(true);
- else
+ } else {
+ if (updated_ids && !(*iter)->is_read())
+ updated_ids->insert((*iter)->id());
(*iter)->set_is_read(true);
+ }
}
}
« 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