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

Side by Side Diff: ui/message_center/message_center_impl.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/message_center/message_center_impl.h" 5 #include "ui/message_center/message_center_impl.h"
6 6
7 #include "base/observer_list.h" 7 #include "base/observer_list.h"
8 #include "ui/message_center/message_center_observer.h" 8 #include "ui/message_center/message_center_observer.h"
9 #include "ui/message_center/notification.h" 9 #include "ui/message_center/notification.h"
10 #include "ui/message_center/notification_list.h" 10 #include "ui/message_center/notification_list.h"
(...skipping 16 matching lines...) Expand all
27 27
28 void MessageCenterImpl::RemoveObserver(MessageCenterObserver* observer) { 28 void MessageCenterImpl::RemoveObserver(MessageCenterObserver* observer) {
29 observer_list_.RemoveObserver(observer); 29 observer_list_.RemoveObserver(observer);
30 } 30 }
31 31
32 void MessageCenterImpl::SetDelegate(Delegate* delegate) { 32 void MessageCenterImpl::SetDelegate(Delegate* delegate) {
33 delegate_ = delegate; 33 delegate_ = delegate;
34 } 34 }
35 35
36 void MessageCenterImpl::SetMessageCenterVisible(bool visible) { 36 void MessageCenterImpl::SetMessageCenterVisible(bool visible) {
37 notification_list_->SetMessageCenterVisible(visible); 37 std::set<std::string> updated_ids;
38 notification_list_->SetMessageCenterVisible(visible, &updated_ids);
39 for (std::set<std::string>::const_iterator iter = updated_ids.begin();
40 iter != updated_ids.end(); ++iter) {
41 FOR_EACH_OBSERVER(MessageCenterObserver, observer_list_,
42 OnNotificationUpdated(*iter));
43 }
38 } 44 }
39 45
40 size_t MessageCenterImpl::NotificationCount() const { 46 size_t MessageCenterImpl::NotificationCount() const {
41 return notification_list_->NotificationCount(); 47 return notification_list_->NotificationCount();
42 } 48 }
43 49
44 size_t MessageCenterImpl::UnreadNotificationCount() const { 50 size_t MessageCenterImpl::UnreadNotificationCount() const {
45 return notification_list_->unread_count(); 51 return notification_list_->unread_count();
46 } 52 }
47 53
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void MessageCenterImpl::SetQuietMode(bool in_quiet_mode) { 233 void MessageCenterImpl::SetQuietMode(bool in_quiet_mode) {
228 notification_list_->SetQuietMode(in_quiet_mode); 234 notification_list_->SetQuietMode(in_quiet_mode);
229 } 235 }
230 236
231 void MessageCenterImpl::EnterQuietModeWithExpire( 237 void MessageCenterImpl::EnterQuietModeWithExpire(
232 const base::TimeDelta& expires_in) { 238 const base::TimeDelta& expires_in) {
233 notification_list_->EnterQuietModeWithExpire(expires_in); 239 notification_list_->EnterQuietModeWithExpire(expires_in);
234 } 240 }
235 241
236 } // namespace message_center 242 } // namespace message_center
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/notification_list.h » ('j') | ui/message_center/notification_list.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698