| Index: chrome/browser/ui/views/message_center/web_notification_tray_win.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/message_center/web_notification_tray_win.cc (revision 188316)
|
| +++ chrome/browser/ui/views/message_center/web_notification_tray_win.cc (working copy)
|
| @@ -25,7 +25,7 @@
|
| #include "ui/message_center/message_center_tray_delegate.h"
|
| #include "ui/message_center/views/message_bubble_base.h"
|
| #include "ui/message_center/views/message_center_bubble.h"
|
| -#include "ui/message_center/views/message_popup_collection.h"
|
| +#include "ui/message_center/views/message_popup_bubble.h"
|
| #include "ui/views/widget/widget.h"
|
|
|
| namespace {
|
| @@ -120,13 +120,17 @@
|
| }
|
|
|
| bool WebNotificationTrayWin::ShowPopups() {
|
| - popup_collection_.reset(
|
| - new message_center::MessagePopupCollection(NULL, message_center()));
|
| + scoped_ptr<message_center::MessagePopupBubble> bubble(
|
| + new message_center::MessagePopupBubble(message_center()));
|
| + popup_bubble_.reset(new internal::NotificationBubbleWrapperWin(
|
| + this,
|
| + bubble.Pass(),
|
| + internal::NotificationBubbleWrapperWin::BUBBLE_TYPE_POPUP));
|
| return true;
|
| }
|
|
|
| void WebNotificationTrayWin::HidePopups() {
|
| - popup_collection_.reset();
|
| + popup_bubble_.reset();
|
| }
|
|
|
| bool WebNotificationTrayWin::ShowMessageCenter() {
|
| @@ -173,8 +177,8 @@
|
| }
|
|
|
| void WebNotificationTrayWin::UpdatePopups() {
|
| - if (popup_collection_.get())
|
| - popup_collection_->UpdatePopups();
|
| + if (popup_bubble_.get())
|
| + popup_bubble_->bubble()->ScheduleUpdate();
|
| };
|
|
|
| void WebNotificationTrayWin::OnMessageCenterTrayChanged() {
|
| @@ -240,6 +244,9 @@
|
| if (message_center_bubble_.get() &&
|
| bubble_view == message_center_bubble_->bubble_view()) {
|
| message_center_tray_->HideMessageCenterBubble();
|
| + } else if (popup_bubble_.get() &&
|
| + bubble_view == popup_bubble_->bubble_view()) {
|
| + message_center_tray_->HidePopupBubble();
|
| }
|
| }
|
|
|
| @@ -256,4 +263,12 @@
|
| message_center_bubble_->bubble());
|
| }
|
|
|
| +message_center::MessagePopupBubble*
|
| +WebNotificationTrayWin::GetPopupBubbleForTest() {
|
| + if (!popup_bubble_.get())
|
| + return NULL;
|
| + return static_cast<message_center::MessagePopupBubble*>(
|
| + popup_bubble_->bubble());
|
| +}
|
| +
|
| } // namespace message_center
|
|
|