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

Unified Diff: ash/shelf/overflow_bubble.cc

Issue 2164733002: mash: Convert ash shelf overflow bubble to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 5 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
« no previous file with comments | « ash/shelf/overflow_bubble.h ('k') | ash/shelf/overflow_bubble_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/overflow_bubble.cc
diff --git a/ash/shelf/overflow_bubble.cc b/ash/shelf/overflow_bubble.cc
deleted file mode 100644
index f19fa9c36ac660fd76719ffde4fcadd4d4c8f2c0..0000000000000000000000000000000000000000
--- a/ash/shelf/overflow_bubble.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2013 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/shelf/overflow_bubble.h"
-
-#include "ash/common/system/tray/tray_background_view.h"
-#include "ash/shelf/overflow_bubble_view.h"
-#include "ash/shelf/shelf.h"
-#include "ash/shelf/shelf_view.h"
-#include "ash/shelf/shelf_widget.h"
-#include "ash/shell.h"
-#include "ui/events/event.h"
-#include "ui/views/widget/widget.h"
-
-namespace ash {
-
-OverflowBubble::OverflowBubble()
- : bubble_(NULL), anchor_(NULL), shelf_view_(NULL) {
- Shell::GetInstance()->AddPointerWatcher(this);
-}
-
-OverflowBubble::~OverflowBubble() {
- Hide();
- Shell::GetInstance()->RemovePointerWatcher(this);
-}
-
-void OverflowBubble::Show(views::View* anchor, ShelfView* shelf_view) {
- Hide();
-
- bubble_ = new OverflowBubbleView();
- bubble_->InitOverflowBubble(anchor, shelf_view);
- shelf_view_ = shelf_view;
- anchor_ = anchor;
-
- TrayBackgroundView::InitializeBubbleAnimations(bubble_->GetWidget());
- bubble_->GetWidget()->AddObserver(this);
- bubble_->GetWidget()->Show();
-}
-
-void OverflowBubble::Hide() {
- if (!IsShowing())
- return;
-
- bubble_->GetWidget()->RemoveObserver(this);
- bubble_->GetWidget()->Close();
- bubble_ = NULL;
- anchor_ = NULL;
- shelf_view_ = NULL;
-}
-
-void OverflowBubble::HideBubbleAndRefreshButton() {
- if (!IsShowing())
- return;
-
- views::View* anchor = anchor_;
- Hide();
- // Update overflow button (|anchor|) status when overflow bubble is hidden
- // by outside event of overflow button.
- anchor->SchedulePaint();
-}
-
-void OverflowBubble::ProcessPressedEvent(
- const gfx::Point& event_location_in_screen) {
- if (IsShowing() && !shelf_view_->IsShowingMenu() &&
- !bubble_->GetBoundsInScreen().Contains(event_location_in_screen) &&
- !anchor_->GetBoundsInScreen().Contains(event_location_in_screen)) {
- HideBubbleAndRefreshButton();
- }
-}
-
-void OverflowBubble::OnMousePressed(const ui::MouseEvent& event,
- const gfx::Point& location_in_screen,
- views::Widget* target) {
- ProcessPressedEvent(location_in_screen);
-}
-
-void OverflowBubble::OnTouchPressed(const ui::TouchEvent& event,
- const gfx::Point& location_in_screen,
- views::Widget* target) {
- ProcessPressedEvent(location_in_screen);
-}
-
-void OverflowBubble::OnWidgetDestroying(views::Widget* widget) {
- DCHECK(widget == bubble_->GetWidget());
- bubble_ = NULL;
- anchor_ = NULL;
- shelf_view_->shelf()->SchedulePaint();
- shelf_view_ = NULL;
-}
-
-} // namespace ash
« no previous file with comments | « ash/shelf/overflow_bubble.h ('k') | ash/shelf/overflow_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698