| OLD | NEW |
| 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 WmShell::Get()->AddPointerWatcher(this, |
| 23 WmShell::Get()->AddPointerWatcher(this, wants_moves); | 23 views::PointerWatcherEventTypes::BASIC); |
| 24 } | 24 } |
| 25 | 25 |
| 26 OverflowBubble::~OverflowBubble() { | 26 OverflowBubble::~OverflowBubble() { |
| 27 Hide(); | 27 Hide(); |
| 28 WmShell::Get()->RemovePointerWatcher(this); | 28 WmShell::Get()->RemovePointerWatcher(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void OverflowBubble::Show(views::View* anchor, ShelfView* shelf_view) { | 31 void OverflowBubble::Show(views::View* anchor, ShelfView* shelf_view) { |
| 32 DCHECK(anchor); | 32 DCHECK(anchor); |
| 33 DCHECK(shelf_view); | 33 DCHECK(shelf_view); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) { | 86 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) { |
| 87 DCHECK(widget == bubble_->GetWidget()); | 87 DCHECK(widget == bubble_->GetWidget()); |
| 88 // Update the overflow button in the parent ShelfView. | 88 // Update the overflow button in the parent ShelfView. |
| 89 anchor_->SchedulePaint(); | 89 anchor_->SchedulePaint(); |
| 90 bubble_ = nullptr; | 90 bubble_ = nullptr; |
| 91 anchor_ = nullptr; | 91 anchor_ = nullptr; |
| 92 shelf_view_ = nullptr; | 92 shelf_view_ = nullptr; |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |