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

Side by Side Diff: ash/common/shelf/overflow_bubble.cc

Issue 2271393002: Wires up drags to pointer watcher adapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/shelf/overflow_bubble.h" 5 #include "ash/common/shelf/overflow_bubble.h"
6 6
7 #include "ash/common/shelf/overflow_bubble_view.h" 7 #include "ash/common/shelf/overflow_bubble_view.h"
8 #include "ash/common/shelf/shelf_view.h" 8 #include "ash/common/shelf/shelf_view.h"
9 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
10 #include "ash/common/system/tray/tray_background_view.h" 10 #include "ash/common/system/tray/tray_background_view.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "ui/gfx/geometry/rect.h" 12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/views/widget/widget.h" 13 #include "ui/views/widget/widget.h"
14 14
15 namespace ash { 15 namespace ash {
16 16
17 OverflowBubble::OverflowBubble(WmShelf* wm_shelf) 17 OverflowBubble::OverflowBubble(WmShelf* wm_shelf)
18 : wm_shelf_(wm_shelf), 18 : wm_shelf_(wm_shelf),
19 bubble_(nullptr), 19 bubble_(nullptr),
20 anchor_(nullptr), 20 anchor_(nullptr),
21 shelf_view_(nullptr) { 21 shelf_view_(nullptr) {
22 const bool wants_moves = false; 22 const bool wants_moves = false;
23 WmShell::Get()->AddPointerWatcher(this, wants_moves); 23 const bool wants_drags = false;
24 WmShell::Get()->AddPointerWatcher(this, wants_moves, wants_drags);
24 } 25 }
25 26
26 OverflowBubble::~OverflowBubble() { 27 OverflowBubble::~OverflowBubble() {
27 Hide(); 28 Hide();
28 WmShell::Get()->RemovePointerWatcher(this); 29 WmShell::Get()->RemovePointerWatcher(this);
29 } 30 }
30 31
31 void OverflowBubble::Show(views::View* anchor, ShelfView* shelf_view) { 32 void OverflowBubble::Show(views::View* anchor, ShelfView* shelf_view) {
32 DCHECK(anchor); 33 DCHECK(anchor);
33 DCHECK(shelf_view); 34 DCHECK(shelf_view);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) { 87 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) {
87 DCHECK(widget == bubble_->GetWidget()); 88 DCHECK(widget == bubble_->GetWidget());
88 // Update the overflow button in the parent ShelfView. 89 // Update the overflow button in the parent ShelfView.
89 anchor_->SchedulePaint(); 90 anchor_->SchedulePaint();
90 bubble_ = nullptr; 91 bubble_ = nullptr;
91 anchor_ = nullptr; 92 anchor_ = nullptr;
92 shelf_view_ = nullptr; 93 shelf_view_ = nullptr;
93 } 94 }
94 95
95 } // namespace ash 96 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698