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

Unified Diff: ui/message_center/message_center.h

Issue 11684003: Make MessageCenter a singleton object and build on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years 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
Index: ui/message_center/message_center.h
diff --git a/ui/message_center/message_center.h b/ui/message_center/message_center.h
index bde776743ed614bce36afb0a8bf41d9a68fa050a..672123fd08e91e0e861b37b7eacb9368086e2d4b 100644
--- a/ui/message_center/message_center.h
+++ b/ui/message_center/message_center.h
@@ -10,6 +10,8 @@
#include "ui/message_center/notification_list.h"
#include "ui/notifications/notification_types.h"
+template <typename T> struct DefaultSingletonTraits;
+
namespace base {
class DictionaryValue;
}
@@ -70,11 +72,13 @@ class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate {
virtual ~Delegate() {}
};
- // |host| is expected to manage any notification bubbles. It may be NULL.
- explicit MessageCenter(Host* host);
+ static MessageCenter* GetInstance();
virtual ~MessageCenter();
+ // Called once to set the host, which is expected to manage any notification
+ // bubbles. |host| can be NULL.
stevenjb 2012/12/27 19:49:34 I would remove the '|host| can be NULL' part of th
dewittj 2012/12/27 23:38:50 Done.
+ void SetHost(Host* host);
// Called once to set the delegate.
void SetDelegate(Delegate* delegate);
@@ -133,6 +137,9 @@ class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate {
virtual NotificationList* GetNotificationList() OVERRIDE;
private:
+ MessageCenter();
+ friend struct DefaultSingletonTraits<MessageCenter>;
+
scoped_ptr<NotificationList> notification_list_;
Host* host_;
Delegate* delegate_;

Powered by Google App Engine
This is Rietveld 408576698