Index: ui/message_center/message_bubble_base.cc |
diff --git a/ash/system/web_notification/web_notification_bubble.cc b/ui/message_center/message_bubble_base.cc |
similarity index 54% |
rename from ash/system/web_notification/web_notification_bubble.cc |
rename to ui/message_center/message_bubble_base.cc |
index 657a8ed2bcc2df60ec15c1ed03d46b11d706535b..3688049d0f7ab3236517d84a3202c2fa4a263612 100644 |
--- a/ash/system/web_notification/web_notification_bubble.cc |
+++ b/ui/message_center/message_bubble_base.cc |
@@ -2,15 +2,15 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ash/system/web_notification/web_notification_bubble.h" |
+#include "ui/message_center/message_bubble_base.h" |
-#include "ash/system/web_notification/web_notification_view.h" |
#include "base/bind.h" |
+#include "ui/message_center/message_view.h" |
#include "ui/views/widget/widget.h" |
#include "ui/views/widget/widget_observer.h" |
namespace { |
-// Delay laying out the WebNotificationBubble until all notifications have been |
+// Delay laying out the MessageBubbleBase until all notifications have been |
// added and icons have had a chance to load. |
const int kUpdateDelayMs = 50; |
const int kNotificationBubbleWidth = 300; |
@@ -18,48 +18,48 @@ const int kNotificationBubbleWidth = 300; |
namespace message_center { |
-const SkColor WebNotificationBubble::kBackgroundColor = |
+const SkColor MessageBubbleBase::kBackgroundColor = |
SkColorSetRGB(0xfe, 0xfe, 0xfe); |
-const SkColor WebNotificationBubble::kHeaderBackgroundColorLight = |
+const SkColor MessageBubbleBase::kHeaderBackgroundColorLight = |
SkColorSetRGB(0xf1, 0xf1, 0xf1); |
-const SkColor WebNotificationBubble::kHeaderBackgroundColorDark = |
+const SkColor MessageBubbleBase::kHeaderBackgroundColorDark = |
SkColorSetRGB(0xe7, 0xe7, 0xe7); |
-WebNotificationBubble::WebNotificationBubble( |
- WebNotificationList::Delegate* list_delegate) |
+MessageBubbleBase::MessageBubbleBase(NotificationList::Delegate* list_delegate) |
: list_delegate_(list_delegate), |
bubble_view_(NULL), |
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) { |
} |
-WebNotificationBubble::~WebNotificationBubble() { |
+MessageBubbleBase::~MessageBubbleBase() { |
if (bubble_view_) |
bubble_view_->reset_delegate(); |
} |
-void WebNotificationBubble::BubbleViewDestroyed() { |
+void MessageBubbleBase::BubbleViewDestroyed() { |
bubble_view_ = NULL; |
OnBubbleViewDestroyed(); |
} |
-void WebNotificationBubble::ScheduleUpdate() { |
+void MessageBubbleBase::ScheduleUpdate() { |
weak_ptr_factory_.InvalidateWeakPtrs(); // Cancel any pending update. |
MessageLoop::current()->PostDelayedTask( |
FROM_HERE, |
- base::Bind(&WebNotificationBubble::UpdateBubbleView, |
+ base::Bind(&MessageBubbleBase::UpdateBubbleView, |
weak_ptr_factory_.GetWeakPtr()), |
base::TimeDelta::FromMilliseconds(kUpdateDelayMs)); |
} |
-bool WebNotificationBubble::IsVisible() const { |
+bool MessageBubbleBase::IsVisible() const { |
return bubble_view() && bubble_view()->GetWidget()->IsVisible(); |
} |
-TrayBubbleView::InitParams WebNotificationBubble::GetDefaultInitParams( |
- TrayBubbleView::AnchorAlignment anchor_alignment) { |
- TrayBubbleView::InitParams init_params(TrayBubbleView::ANCHOR_TYPE_TRAY, |
- anchor_alignment, |
- kNotificationBubbleWidth); |
+views::TrayBubbleView::InitParams MessageBubbleBase::GetDefaultInitParams( |
+ views::TrayBubbleView::AnchorAlignment anchor_alignment) { |
+ views::TrayBubbleView::InitParams init_params( |
+ views::TrayBubbleView::ANCHOR_TYPE_TRAY, |
+ anchor_alignment, |
+ kNotificationBubbleWidth); |
init_params.top_color = kBackgroundColor; |
init_params.arrow_color = kHeaderBackgroundColorDark; |
init_params.bubble_width = kWebNotificationWidth; |