diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 07:28:33 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 07:28:33 +0000 |
commit | 2e18c1f5a1c4db0a08b14dd4e04c1a86807e9393 (patch) | |
tree | 22050d1eec969119dd121ed27774751f7a82c1e7 /ui/message_center | |
parent | abe59334ca59797e8d5d909d6bc2305288260aaa (diff) | |
download | chromium_src-2e18c1f5a1c4db0a08b14dd4e04c1a86807e9393.zip chromium_src-2e18c1f5a1c4db0a08b14dd4e04c1a86807e9393.tar.gz chromium_src-2e18c1f5a1c4db0a08b14dd4e04c1a86807e9393.tar.bz2 |
Marks notifications as shown slightly earlier for message center.
Current: all marked as read and shown when closed
New: all marked as shown when opened, read when closed
If there're notifications of 'shown=false' but the center actually shows,
the message center misunderstand the current status at OnNotificationClicked().
BUG=169388
Review URL: https://chromiumcodereview.appspot.com/11874015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r-- | ui/message_center/notification_list.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ui/message_center/notification_list.cc b/ui/message_center/notification_list.cc index ac447fc..2975360 100644 --- a/ui/message_center/notification_list.cc +++ b/ui/message_center/notification_list.cc @@ -35,17 +35,20 @@ void NotificationList::SetMessageCenterVisible(bool visible) { if (message_center_visible_ == visible) return; message_center_visible_ = visible; - if (!visible) { - // When the list is hidden, clear the unread count, and mark all - // notifications as read and shown. + // 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) unread_count_ = 0; - for (NotificationMap::iterator mapiter = notifications_.begin(); - mapiter != notifications_.end(); ++mapiter) { - for (Notifications::iterator iter = mapiter->second.begin(); - iter != mapiter->second.end(); ++iter) { - iter->is_read = true; + + for (NotificationMap::iterator mapiter = notifications_.begin(); + mapiter != notifications_.end(); ++mapiter) { + for (Notifications::iterator iter = mapiter->second.begin(); + iter != mapiter->second.end(); ++iter) { + if (visible) iter->shown_as_popup = true; - } + else + iter->is_read = true; } } } |