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

Unified Diff: ash/common/shelf/overflow_bubble.cc

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 10 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/common/shelf/overflow_bubble.h ('k') | ash/common/shelf/overflow_bubble_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/overflow_bubble.cc
diff --git a/ash/common/shelf/overflow_bubble.cc b/ash/common/shelf/overflow_bubble.cc
deleted file mode 100644
index 6f1e311f2a180fe98f49597759af6fafcbfe7fb3..0000000000000000000000000000000000000000
--- a/ash/common/shelf/overflow_bubble.cc
+++ /dev/null
@@ -1,94 +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/common/shelf/overflow_bubble.h"
-
-#include "ash/common/shelf/overflow_bubble_view.h"
-#include "ash/common/shelf/overflow_button.h"
-#include "ash/common/shelf/shelf_view.h"
-#include "ash/common/shelf/wm_shelf.h"
-#include "ash/common/system/tray/tray_background_view.h"
-#include "ash/common/wm_shell.h"
-#include "ui/gfx/geometry/rect.h"
-#include "ui/views/widget/widget.h"
-
-namespace ash {
-
-OverflowBubble::OverflowBubble(WmShelf* wm_shelf)
- : wm_shelf_(wm_shelf),
- bubble_(nullptr),
- overflow_button_(nullptr),
- shelf_view_(nullptr) {
- DCHECK(wm_shelf_);
- WmShell::Get()->AddPointerWatcher(this,
- views::PointerWatcherEventTypes::BASIC);
-}
-
-OverflowBubble::~OverflowBubble() {
- Hide();
- WmShell::Get()->RemovePointerWatcher(this);
-}
-
-void OverflowBubble::Show(OverflowButton* overflow_button,
- ShelfView* shelf_view) {
- DCHECK(overflow_button);
- DCHECK(shelf_view);
-
- Hide();
-
- bubble_ = new OverflowBubbleView(wm_shelf_);
- bubble_->InitOverflowBubble(overflow_button, shelf_view);
- shelf_view_ = shelf_view;
- overflow_button_ = overflow_button;
-
- TrayBackgroundView::InitializeBubbleAnimations(bubble_->GetWidget());
- bubble_->GetWidget()->AddObserver(this);
- bubble_->GetWidget()->Show();
-
- overflow_button->OnOverflowBubbleShown();
-}
-
-void OverflowBubble::Hide() {
- if (!IsShowing())
- return;
-
- OverflowButton* overflow_button = overflow_button_;
-
- bubble_->GetWidget()->RemoveObserver(this);
- bubble_->GetWidget()->Close();
- bubble_ = nullptr;
- overflow_button_ = nullptr;
- shelf_view_ = nullptr;
-
- overflow_button->OnOverflowBubbleHidden();
-}
-
-void OverflowBubble::ProcessPressedEvent(
- const gfx::Point& event_location_in_screen) {
- if (IsShowing() && !shelf_view_->IsShowingMenu() &&
- !bubble_->GetBoundsInScreen().Contains(event_location_in_screen) &&
- !overflow_button_->GetBoundsInScreen().Contains(
- event_location_in_screen)) {
- Hide();
- }
-}
-
-void OverflowBubble::OnPointerEventObserved(
- const ui::PointerEvent& event,
- const gfx::Point& location_in_screen,
- views::Widget* target) {
- if (event.type() == ui::ET_POINTER_DOWN)
- ProcessPressedEvent(location_in_screen);
-}
-
-void OverflowBubble::OnWidgetDestroying(views::Widget* widget) {
- DCHECK(widget == bubble_->GetWidget());
- // Update the overflow button in the parent ShelfView.
- overflow_button_->SchedulePaint();
- bubble_ = nullptr;
- overflow_button_ = nullptr;
- shelf_view_ = nullptr;
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/shelf/overflow_bubble.h ('k') | ash/common/shelf/overflow_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698