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

Side by Side Diff: ui/message_center/message_center.cc

Issue 11819048: Implement message center on Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Now with more tests, and corrected copyright notices. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "ui/message_center/message_center.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 10
11 namespace message_center { 11 namespace message_center {
12 12
13 //------------------------------------------------------------------------------ 13 //------------------------------------------------------------------------------
14 14
15 // static 15 MessageCenter::MessageCenter()
16 MessageCenter* MessageCenter::GetInstance() { 16 : delegate_(NULL) {
17 return Singleton<MessageCenter>::get(); 17 notification_list_.reset(new NotificationList(this));
18 } 18 }
19 19
20 MessageCenter::~MessageCenter() { 20 MessageCenter::~MessageCenter() {
21 notification_list_.reset(); 21 notification_list_.reset();
22 } 22 }
23 23
24 void MessageCenter::AddObserver(Observer* observer) { 24 void MessageCenter::AddObserver(Observer* observer) {
25 observer_list_.AddObserver(observer); 25 observer_list_.AddObserver(observer);
26 } 26 }
27 27
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return notification_list_.get(); 165 return notification_list_.get();
166 } 166 }
167 167
168 void MessageCenter::Delegate::OnButtonClicked(const std::string& id, 168 void MessageCenter::Delegate::OnButtonClicked(const std::string& id,
169 int button_index) { 169 int button_index) {
170 } 170 }
171 171
172 //------------------------------------------------------------------------------ 172 //------------------------------------------------------------------------------
173 // Private. 173 // Private.
174 174
175 MessageCenter::MessageCenter()
176 : delegate_(NULL) {
177 notification_list_.reset(new NotificationList(this));
178 }
179
180 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { 175 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) {
181 FOR_EACH_OBSERVER(Observer, 176 FOR_EACH_OBSERVER(Observer,
182 observer_list_, 177 observer_list_,
183 OnMessageCenterChanged(new_notification)); 178 OnMessageCenterChanged(new_notification));
184 } 179 }
185 180
186 181
187 } // namespace message_center 182 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698