Chromium Code Reviews| 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()))); |
| } |
| } |