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..26c5874379ac5954af25b61d0435323b5a128a51 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_ = ash::Shell::GetInstance()->message_center(); |
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()))); |
} |
} |