| 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/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
| 9 #include "ash/common/system/tray/tray_background_view.h" | 9 #include "ash/common/system/tray/tray_background_view.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| 11 #include "ash/shelf/shelf_view.h" | 11 #include "ash/shelf/shelf_view.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 WmShell::Get()->AddPointerWatcher(this); | 22 WmShell::Get()->AddPointerDownWatcher(this); |
| 23 } | 23 } |
| 24 | 24 |
| 25 OverflowBubble::~OverflowBubble() { | 25 OverflowBubble::~OverflowBubble() { |
| 26 Hide(); | 26 Hide(); |
| 27 WmShell::Get()->RemovePointerWatcher(this); | 27 WmShell::Get()->RemovePointerDownWatcher(this); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void OverflowBubble::Show(views::View* anchor, ShelfView* shelf_view) { | 30 void OverflowBubble::Show(views::View* anchor, ShelfView* shelf_view) { |
| 31 Hide(); | 31 Hide(); |
| 32 | 32 |
| 33 bubble_ = new OverflowBubbleView(wm_shelf_); | 33 bubble_ = new OverflowBubbleView(wm_shelf_); |
| 34 bubble_->InitOverflowBubble(anchor, shelf_view); | 34 bubble_->InitOverflowBubble(anchor, shelf_view); |
| 35 shelf_view_ = shelf_view; | 35 shelf_view_ = shelf_view; |
| 36 anchor_ = anchor; | 36 anchor_ = anchor; |
| 37 | 37 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 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 bubble_ = NULL; | 88 bubble_ = NULL; |
| 89 anchor_ = NULL; | 89 anchor_ = NULL; |
| 90 wm_shelf_->SchedulePaint(); | 90 wm_shelf_->SchedulePaint(); |
| 91 shelf_view_ = NULL; | 91 shelf_view_ = NULL; |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace ash | 94 } // namespace ash |
| OLD | NEW |