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

Unified Diff: ash/system/web_notification/web_notification_tray.cc

Issue 11958025: Start delegating notifications to MessageCenter on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: ash/system/web_notification/web_notification_tray.cc
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index 05e6f6e7ba5aa7defaf5582d8afb58cc69795d9e..87417112b350ffddb33e51308ba649de93cd0a00 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -83,7 +83,7 @@ WebNotificationTray::WebNotificationTray(
: internal::TrayBackgroundView(status_area_widget),
button_(NULL),
show_message_center_on_unlock_(false) {
- message_center_ = message_center::MessageCenter::GetInstance();
+ message_center_.reset(new message_center::MessageCenter);
stevenjb 2013/01/17 01:53:44 This is a problem. We may have more than one WebNo
message_center_->AddObserver(this);
button_ = new views::ImageButton(this);
button_->set_triggerable_event_flags(
@@ -94,7 +94,7 @@ WebNotificationTray::WebNotificationTray(
}
WebNotificationTray::~WebNotificationTray() {
- // Ensure the message center doesn't notify a destroyed object.
+ // Ensure the message center doesn't notify an object under destruction.
message_center_->RemoveObserver(this);
// Release any child views that might have back pointers before ~View().
message_center_bubble_.reset();
@@ -118,7 +118,7 @@ void WebNotificationTray::ShowMessageCenterBubble() {
UpdateTray();
HidePopupBubble();
message_center::MessageCenterBubble* bubble =
- new message_center::MessageCenterBubble(message_center_);
+ new message_center::MessageCenterBubble(message_center_.get());
// Sets the maximum height of the bubble based on the screen.
// TODO(mukai): move this to WebNotificationBubbleWrapper if it's safe
// to set the height of the popup.
@@ -172,7 +172,7 @@ void WebNotificationTray::ShowPopupBubble() {
popup_bubble_.reset(
new internal::WebNotificationBubbleWrapper(
this, new message_center::MessagePopupBubble(
- message_center_)));
+ message_center_.get())));
}
}
« no previous file with comments | « ash/system/web_notification/web_notification_tray.h ('k') | chrome/browser/extensions/api/notification/notification_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698