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

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: 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..8c51bd26bdd3e82d9aac46b6ecce822b227ce3c0 100644
--- a/ui/message_center/notification_list.cc
+++ b/ui/message_center/notification_list.cc
@@ -48,22 +48,35 @@ 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;
+
+ std::set<std::string> dummy_ids;
dewittj 2013/04/16 23:59:13 I don't love keeping a dummy data structure around
Jun Mukai 2013/04/17 01:04:43 Done.
+ if (!updated_ids)
+ updated_ids = &dummy_ids;
+
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
// notifications as read.
- if (!visible)
+ if (!visible) {
dewittj 2013/04/16 23:59:13 no braces
Jun Mukai 2013/04/17 01:04:43 Done.
unread_count_ = 0;
+ }
for (Notifications::iterator iter = notifications_.begin();
iter != notifications_.end(); ++iter) {
- if (visible)
+ if (visible) {
+ if (!(*iter)->shown_as_popup())
+ updated_ids->insert((*iter)->id());
(*iter)->set_shown_as_popup(true);
- else
+ } else {
+ if (!(*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