summaryrefslogtreecommitdiffstats
path: root/ui/message_center
diff options
context:
space:
mode:
authordimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 19:40:10 +0000
committerdimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 19:40:10 +0000
commit8393aa6c8d53eb07bd1c50293a0eae362581f4f4 (patch)
treeca1491882fa8cd6fde332eeb73f1e52bfda599e3 /ui/message_center
parent90fe5e98b89802195a919e1a1d07e114b37e2550 (diff)
downloadchromium_src-8393aa6c8d53eb07bd1c50293a0eae362581f4f4.zip
chromium_src-8393aa6c8d53eb07bd1c50293a0eae362581f4f4.tar.gz
chromium_src-8393aa6c8d53eb07bd1c50293a0eae362581f4f4.tar.bz2
Start delegating notifications to MessageCenter on Windows.
This is the next step. MessageCeneterNotificationManager now creates MessageCenter and forwards new notificaitons to it. 1. Upon chat with dewittj@, we decided to not trat MessageCenter as Singleton since there are issues on process shutdown (MessageCenter should exist while MessageCeneterNotificationManager does). Changes that. 2. MessageCeneterNotificationManager for now keeps a map of all displayed Notification objects - to make sure NotificationDelegates are invoked and Profiles are tracked. 3. Started to pass ExtensionId into as origin_id from Notification API, to scope the notification updates to a specific app (bug 168924) 4. Additionally scoped update of notifications by profile, since in multiprofile case the update was also not scoped by profile. This does not yet render anything, since there is no rendering Observer set for the MessageCenter. Will coordinate with Justin. Next step would be to land a test for the add/update/remove logic, and also move image download from Balloon_view_ash to NotificationUIManagerImpl, where notifications wait until they are ready to be displayed. BUG=168924,168605 Review URL: https://chromiumcodereview.appspot.com/11958025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178352 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center')
-rw-r--r--ui/message_center/message_center.cc12
-rw-r--r--ui/message_center/message_center.h6
2 files changed, 4 insertions, 14 deletions
diff --git a/ui/message_center/message_center.cc b/ui/message_center/message_center.cc
index 6530005..c449a05 100644
--- a/ui/message_center/message_center.cc
+++ b/ui/message_center/message_center.cc
@@ -11,10 +11,9 @@
namespace message_center {
//------------------------------------------------------------------------------
-
-// static
-MessageCenter* MessageCenter::GetInstance() {
- return Singleton<MessageCenter>::get();
+MessageCenter::MessageCenter()
+ : delegate_(NULL) {
+ notification_list_.reset(new NotificationList(this));
}
MessageCenter::~MessageCenter() {
@@ -178,11 +177,6 @@ void MessageCenter::Delegate::OnButtonClicked(const std::string& id,
//------------------------------------------------------------------------------
// Private.
-MessageCenter::MessageCenter()
- : delegate_(NULL) {
- notification_list_.reset(new NotificationList(this));
-}
-
void MessageCenter::NotifyMessageCenterChanged(bool new_notification) {
FOR_EACH_OBSERVER(Observer,
observer_list_,
diff --git a/ui/message_center/message_center.h b/ui/message_center/message_center.h
index f060114..53bb1d0 100644
--- a/ui/message_center/message_center.h
+++ b/ui/message_center/message_center.h
@@ -74,8 +74,7 @@ class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate {
virtual ~Delegate() {}
};
- static MessageCenter* GetInstance();
-
+ MessageCenter();
virtual ~MessageCenter();
// Called to set the delegate. Generally called only once, except in tests.
@@ -148,9 +147,6 @@ class MESSAGE_CENTER_EXPORT MessageCenter : public NotificationList::Delegate {
virtual NotificationList* GetNotificationList() OVERRIDE;
private:
- friend struct DefaultSingletonTraits<MessageCenter>;
- MessageCenter();
-
// Calls OnMessageCenterChanged on each observer.
void NotifyMessageCenterChanged(bool new_notification);