Chromium Code Reviews| 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" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 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 WmShell::Get()->AddPointerWatcher(this, wants_moves); |
| 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) { |
|
msw
2016/08/22 21:48:25
aside: it'd be nice to merge OverflowBubble and Ov
| |
| 32 DCHECK(anchor); | |
| 33 DCHECK(shelf_view); | |
| 34 | |
| 32 Hide(); | 35 Hide(); |
| 33 | 36 |
| 34 bubble_ = new OverflowBubbleView(wm_shelf_); | 37 bubble_ = new OverflowBubbleView(wm_shelf_); |
| 35 bubble_->InitOverflowBubble(anchor, shelf_view); | 38 bubble_->InitOverflowBubble(anchor, shelf_view); |
| 36 shelf_view_ = shelf_view; | 39 shelf_view_ = shelf_view; |
| 37 anchor_ = anchor; | 40 anchor_ = anchor; |
| 38 | 41 |
| 39 TrayBackgroundView::InitializeBubbleAnimations(bubble_->GetWidget()); | 42 TrayBackgroundView::InitializeBubbleAnimations(bubble_->GetWidget()); |
| 40 bubble_->GetWidget()->AddObserver(this); | 43 bubble_->GetWidget()->AddObserver(this); |
| 41 bubble_->GetWidget()->Show(); | 44 bubble_->GetWidget()->Show(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 void OverflowBubble::OnPointerEventObserved( | 78 void OverflowBubble::OnPointerEventObserved( |
| 76 const ui::PointerEvent& event, | 79 const ui::PointerEvent& event, |
| 77 const gfx::Point& location_in_screen, | 80 const gfx::Point& location_in_screen, |
| 78 views::Widget* target) { | 81 views::Widget* target) { |
| 79 if (event.type() == ui::ET_POINTER_DOWN) | 82 if (event.type() == ui::ET_POINTER_DOWN) |
| 80 ProcessPressedEvent(location_in_screen); | 83 ProcessPressedEvent(location_in_screen); |
| 81 } | 84 } |
| 82 | 85 |
| 83 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) { | 86 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) { |
| 84 DCHECK(widget == bubble_->GetWidget()); | 87 DCHECK(widget == bubble_->GetWidget()); |
| 85 bubble_ = NULL; | 88 // Update the overflow button in the parent ShelfView. |
|
msw
2016/08/22 21:48:25
Hmm, it's hard to tell if this will be called afte
| |
| 86 anchor_ = NULL; | 89 anchor_->SchedulePaint(); |
| 87 wm_shelf_->SchedulePaint(); | 90 bubble_ = nullptr; |
| 88 shelf_view_ = NULL; | 91 anchor_ = nullptr; |
| 92 shelf_view_ = nullptr; | |
| 89 } | 93 } |
| 90 | 94 |
| 91 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |