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

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

Issue 11229022: Move ash/system/web_notification message_center to ui/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again. Created 8 years, 2 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_bubble.cc
diff --git a/ash/system/web_notification/web_notification_bubble.cc b/ash/system/web_notification/web_notification_bubble.cc
deleted file mode 100644
index 657a8ed2bcc2df60ec15c1ed03d46b11d706535b..0000000000000000000000000000000000000000
--- a/ash/system/web_notification/web_notification_bubble.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// 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 "ash/system/web_notification/web_notification_view.h"
-#include "base/bind.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
-// added and icons have had a chance to load.
-const int kUpdateDelayMs = 50;
-const int kNotificationBubbleWidth = 300;
-}
-
-namespace message_center {
-
-const SkColor WebNotificationBubble::kBackgroundColor =
- SkColorSetRGB(0xfe, 0xfe, 0xfe);
-const SkColor WebNotificationBubble::kHeaderBackgroundColorLight =
- SkColorSetRGB(0xf1, 0xf1, 0xf1);
-const SkColor WebNotificationBubble::kHeaderBackgroundColorDark =
- SkColorSetRGB(0xe7, 0xe7, 0xe7);
-
-WebNotificationBubble::WebNotificationBubble(
- WebNotificationList::Delegate* list_delegate)
- : list_delegate_(list_delegate),
- bubble_view_(NULL),
- ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
-}
-
-WebNotificationBubble::~WebNotificationBubble() {
- if (bubble_view_)
- bubble_view_->reset_delegate();
-}
-
-void WebNotificationBubble::BubbleViewDestroyed() {
- bubble_view_ = NULL;
- OnBubbleViewDestroyed();
-}
-
-void WebNotificationBubble::ScheduleUpdate() {
- weak_ptr_factory_.InvalidateWeakPtrs(); // Cancel any pending update.
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&WebNotificationBubble::UpdateBubbleView,
- weak_ptr_factory_.GetWeakPtr()),
- base::TimeDelta::FromMilliseconds(kUpdateDelayMs));
-}
-
-bool WebNotificationBubble::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);
- init_params.top_color = kBackgroundColor;
- init_params.arrow_color = kHeaderBackgroundColorDark;
- init_params.bubble_width = kWebNotificationWidth;
- return init_params;
-}
-
-} // namespace message_center
« no previous file with comments | « ash/system/web_notification/web_notification_bubble.h ('k') | ash/system/web_notification/web_notification_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698