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

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

Issue 2178163002: Add ink drop ripple to shelf overflow button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 4 years, 3 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 | « no previous file | ash/common/shelf/overflow_bubble.cc » ('j') | ash/shelf/shelf_view_unittest.cc » ('J')
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 #ifndef ASH_COMMON_SHELF_OVERFLOW_BUBBLE_H_ 5 #ifndef ASH_COMMON_SHELF_OVERFLOW_BUBBLE_H_
6 #define ASH_COMMON_SHELF_OVERFLOW_BUBBLE_H_ 6 #define ASH_COMMON_SHELF_OVERFLOW_BUBBLE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/views/pointer_watcher.h" 9 #include "ui/views/pointer_watcher.h"
10 #include "ui/views/widget/widget_observer.h" 10 #include "ui/views/widget/widget_observer.h"
11 11
12 namespace ui { 12 namespace ui {
13 class PointerEvent; 13 class PointerEvent;
14 } 14 }
15 15
16 namespace views { 16 namespace views {
17 class View; 17 class View;
18 } 18 }
19 19
20 namespace ash { 20 namespace ash {
21 class OverflowBubbleView; 21 class OverflowBubbleView;
22 class OverflowButton;
22 class ShelfView; 23 class ShelfView;
23 class WmShelf; 24 class WmShelf;
24 25
25 // OverflowBubble shows shelf items that won't fit on the main shelf in a 26 // OverflowBubble shows shelf items that won't fit on the main shelf in a
26 // separate bubble. 27 // separate bubble.
27 class OverflowBubble : public views::PointerWatcher, 28 class OverflowBubble : public views::PointerWatcher,
28 public views::WidgetObserver { 29 public views::WidgetObserver {
29 public: 30 public:
30 // |wm_shelf| is the shelf that spawns the bubble. 31 // |wm_shelf| is the shelf that spawns the bubble.
31 explicit OverflowBubble(WmShelf* wm_shelf); 32 explicit OverflowBubble(WmShelf* wm_shelf);
32 ~OverflowBubble() override; 33 ~OverflowBubble() override;
33 34
34 // Shows an bubble pointing to |anchor| with |shelf_view| as its content. 35 // Shows an bubble pointing to |overflow_button| with |shelf_view| as its
35 // This |shelf_view| is different than the main shelf's view and only contains 36 // content. This |shelf_view| is different than the main shelf's view and
36 // the overflow items. 37 // only contains the overflow items.
37 void Show(views::View* anchor, ShelfView* shelf_view); 38 void Show(OverflowButton* overflow_button, ShelfView* shelf_view);
38 39
39 void Hide(); 40 void Hide();
40 41
41 // Hides the bubble and schedules paint for overflow button.
42 void HideBubbleAndRefreshButton();
43
44 bool IsShowing() const { return !!bubble_; } 42 bool IsShowing() const { return !!bubble_; }
45 ShelfView* shelf_view() { return shelf_view_; } 43 ShelfView* shelf_view() { return shelf_view_; }
46 OverflowBubbleView* bubble_view() { return bubble_; } 44 OverflowBubbleView* bubble_view() { return bubble_; }
47 45
48 private: 46 private:
49 void ProcessPressedEvent(const gfx::Point& event_location_in_screen); 47 void ProcessPressedEvent(const gfx::Point& event_location_in_screen);
50 48
51 // views::PointerWatcher: 49 // views::PointerWatcher:
52 void OnPointerEventObserved(const ui::PointerEvent& event, 50 void OnPointerEventObserved(const ui::PointerEvent& event,
53 const gfx::Point& location_in_screen, 51 const gfx::Point& location_in_screen,
54 views::Widget* target) override; 52 views::Widget* target) override;
55 53
56 // Overridden from views::WidgetObserver: 54 // Overridden from views::WidgetObserver:
57 void OnWidgetDestroying(views::Widget* widget) override; 55 void OnWidgetDestroying(views::Widget* widget) override;
58 56
59 WmShelf* wm_shelf_; 57 WmShelf* wm_shelf_;
60 OverflowBubbleView* bubble_; // Owned by views hierarchy. 58 OverflowBubbleView* bubble_; // Owned by views hierarchy.
61 views::View* anchor_; // Owned by ShelfView. 59 OverflowButton* overflow_button_; // Owned by ShelfView.
62 60
63 // ShelfView containing the overflow items. Owned by |bubble_|. 61 // ShelfView containing the overflow items. Owned by |bubble_|.
64 ShelfView* shelf_view_; 62 ShelfView* shelf_view_;
65 63
66 DISALLOW_COPY_AND_ASSIGN(OverflowBubble); 64 DISALLOW_COPY_AND_ASSIGN(OverflowBubble);
67 }; 65 };
68 66
69 } // namespace ash 67 } // namespace ash
70 68
71 #endif // ASH_COMMON_SHELF_OVERFLOW_BUBBLE_H_ 69 #endif // ASH_COMMON_SHELF_OVERFLOW_BUBBLE_H_
OLDNEW
« no previous file with comments | « no previous file | ash/common/shelf/overflow_bubble.cc » ('j') | ash/shelf/shelf_view_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698