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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
12 #include "ui/views/animation/ink_drop_host_view.h" | 12 #include "ui/views/animation/ink_drop_host_view.h" |
13 #include "ui/views/controls/image_view.h" | 13 #include "ui/views/controls/image_view.h" |
14 #include "ui/views/widget/widget_observer.h" | 14 #include "ui/views/widget/widget_observer.h" |
15 | 15 |
16 class CommandUpdater; | 16 class CommandUpdater; |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 struct VectorIcon; | 19 struct VectorIcon; |
20 } | 20 } |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 class BubbleDialogDelegateView; | 23 class BubbleDialogDelegateView; |
24 } | 24 } |
25 | 25 |
26 // Represents an icon on the omnibox that shows a bubble when clicked. | 26 // Represents an icon on the omnibox that shows a bubble when clicked. |
27 class BubbleIconView : public views::InkDropHostView, | 27 class BubbleIconView : public views::InkDropHostView, |
bruthig
2017/03/22 17:20:16
If you're not going to use a CustomButton for this
spqchan
2017/03/24 17:58:03
I can do it :) I might be making more changes to i
| |
28 public views::WidgetObserver { | 28 public views::WidgetObserver { |
29 public: | 29 public: |
30 void Init(); | 30 void Init(); |
31 | 31 |
32 protected: | 32 protected: |
33 enum ExecuteSource { | 33 enum ExecuteSource { |
34 EXECUTE_SOURCE_MOUSE, | 34 EXECUTE_SOURCE_MOUSE, |
35 EXECUTE_SOURCE_KEYBOARD, | 35 EXECUTE_SOURCE_KEYBOARD, |
36 EXECUTE_SOURCE_GESTURE, | 36 EXECUTE_SOURCE_GESTURE, |
37 }; | 37 }; |
(...skipping 29 matching lines...) Expand all Loading... | |
67 bool OnMousePressed(const ui::MouseEvent& event) override; | 67 bool OnMousePressed(const ui::MouseEvent& event) override; |
68 void OnMouseReleased(const ui::MouseEvent& event) override; | 68 void OnMouseReleased(const ui::MouseEvent& event) override; |
69 bool OnKeyPressed(const ui::KeyEvent& event) override; | 69 bool OnKeyPressed(const ui::KeyEvent& event) override; |
70 bool OnKeyReleased(const ui::KeyEvent& event) override; | 70 bool OnKeyReleased(const ui::KeyEvent& event) override; |
71 void ViewHierarchyChanged( | 71 void ViewHierarchyChanged( |
72 const ViewHierarchyChangedDetails& details) override; | 72 const ViewHierarchyChangedDetails& details) override; |
73 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 73 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
74 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; | 74 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; |
75 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; | 75 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; |
76 std::unique_ptr<views::InkDrop> CreateInkDrop() override; | 76 std::unique_ptr<views::InkDrop> CreateInkDrop() override; |
77 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | |
77 SkColor GetInkDropBaseColor() const override; | 78 SkColor GetInkDropBaseColor() const override; |
78 | 79 |
79 // ui::EventHandler: | 80 // ui::EventHandler: |
80 void OnGestureEvent(ui::GestureEvent* event) override; | 81 void OnGestureEvent(ui::GestureEvent* event) override; |
81 | 82 |
82 // views::WidgetObserver: | 83 // views::WidgetObserver: |
83 void OnWidgetDestroying(views::Widget* widget) override; | 84 void OnWidgetDestroying(views::Widget* widget) override; |
84 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; | 85 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
85 | 86 |
86 protected: | 87 protected: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 | 123 |
123 // This is used to check if the bookmark bubble was showing during the mouse | 124 // This is used to check if the bookmark bubble was showing during the mouse |
124 // pressed event. If this is true then the mouse released event is ignored to | 125 // pressed event. If this is true then the mouse released event is ignored to |
125 // prevent the bubble from reshowing. | 126 // prevent the bubble from reshowing. |
126 bool suppress_mouse_released_action_; | 127 bool suppress_mouse_released_action_; |
127 | 128 |
128 DISALLOW_COPY_AND_ASSIGN(BubbleIconView); | 129 DISALLOW_COPY_AND_ASSIGN(BubbleIconView); |
129 }; | 130 }; |
130 | 131 |
131 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | 132 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ |
OLD | NEW |