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

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

Issue 2267803003: ash: Remove unnecessary WmShelf::SchedulePaint() method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « ash/common/shelf/overflow_bubble.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 10 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « ash/common/shelf/overflow_bubble.h ('k') | ash/common/shelf/wm_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698