Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 5 #ifndef UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
| 6 #define UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 6 #define UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 ANCHOR_ALIGNMENT_BOTTOM, | 41 ANCHOR_ALIGNMENT_BOTTOM, |
| 42 ANCHOR_ALIGNMENT_LEFT, | 42 ANCHOR_ALIGNMENT_LEFT, |
| 43 ANCHOR_ALIGNMENT_RIGHT, | 43 ANCHOR_ALIGNMENT_RIGHT, |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 class VIEWS_EXPORT Delegate { | 46 class VIEWS_EXPORT Delegate { |
| 47 public: | 47 public: |
| 48 typedef TrayBubbleView::AnchorAlignment AnchorAlignment; | 48 typedef TrayBubbleView::AnchorAlignment AnchorAlignment; |
| 49 | 49 |
| 50 Delegate() {} | 50 Delegate() {} |
| 51 virtual ~Delegate() {} | 51 virtual ~Delegate() {} |
|
msw
2017/07/17 20:45:03
optional nit: move this to the cc file too.
minch1
2017/07/18 03:59:00
Done.
| |
| 52 | 52 |
| 53 // Called when the view is destroyed. Any pointers to the view should be | 53 // Called when the view is destroyed. Any pointers to the view should be |
| 54 // cleared when this gets called. | 54 // cleared when this gets called. |
| 55 virtual void BubbleViewDestroyed() = 0; | 55 virtual void BubbleViewDestroyed(); |
| 56 | 56 |
| 57 // Called when the mouse enters/exits the view. | 57 // Called when the mouse enters/exits the view. |
| 58 // Note: This event will only be called if the mouse gets actively moved by | 58 // Note: This event will only be called if the mouse gets actively moved by |
| 59 // the user to enter the view. | 59 // the user to enter the view. |
| 60 virtual void OnMouseEnteredView() = 0; | 60 virtual void OnMouseEnteredView(); |
| 61 virtual void OnMouseExitedView() = 0; | 61 virtual void OnMouseExitedView(); |
| 62 | 62 |
| 63 // Called to register/unregister accelerators for TrayBubbleView. | 63 // Called to register/unregister accelerators for TrayBubbleView. |
| 64 // TrayBubbleView wants to register those accelerators at the global level. | 64 // TrayBubbleView wants to register those accelerators at the global level. |
| 65 // Those accelerators are used to activate TrayBubbleView, i.e. those | 65 // Those accelerators are used to activate TrayBubbleView, i.e. those |
| 66 // accelerators need to be processed even if TrayBubbleView is not active. | 66 // accelerators need to be processed even if TrayBubbleView is not active. |
| 67 // UnregisterAllAccelerators can be called even if RegisterAccelerators is | 67 // UnregisterAllAccelerators can be called even if RegisterAccelerators is |
| 68 // not called. | 68 // not called. |
| 69 virtual void RegisterAccelerators( | 69 virtual void RegisterAccelerators( |
| 70 const std::vector<ui::Accelerator>& accelerators, | 70 const std::vector<ui::Accelerator>& accelerators, |
| 71 TrayBubbleView* tray_bubble_view) = 0; | 71 TrayBubbleView* tray_bubble_view); |
| 72 virtual void UnregisterAllAccelerators( | 72 virtual void UnregisterAllAccelerators(TrayBubbleView* tray_bubble_view); |
| 73 TrayBubbleView* tray_bubble_view) = 0; | |
| 74 | 73 |
| 75 // Called from GetAccessibleNodeData(); should return the appropriate | 74 // Called from GetAccessibleNodeData(); should return the appropriate |
| 76 // accessible name for the bubble. | 75 // accessible name for the bubble. |
| 77 virtual base::string16 GetAccessibleNameForBubble() = 0; | 76 virtual base::string16 GetAccessibleNameForBubble(); |
| 78 | 77 |
| 79 // Should return true if extra keyboard accessibility is enabled. | 78 // Should return true if extra keyboard accessibility is enabled. |
| 80 // TrayBubbleView will put focus on the default item if extra keyboard | 79 // TrayBubbleView will put focus on the default item if extra keyboard |
| 81 // accessibility is enabled. | 80 // accessibility is enabled. |
| 82 virtual bool ShouldEnableExtraKeyboardAccessibility() = 0; | 81 virtual bool ShouldEnableExtraKeyboardAccessibility(); |
| 83 | 82 |
| 84 // Called when a bubble wants to hide/destroy itself (e.g. last visible | 83 // Called when a bubble wants to hide/destroy itself (e.g. last visible |
| 85 // child view was closed). | 84 // child view was closed). |
| 86 virtual void HideBubble(const TrayBubbleView* bubble_view) = 0; | 85 virtual void HideBubble(const TrayBubbleView* bubble_view); |
| 86 | |
| 87 virtual bool ProcessGestureEventForBubble(ui::GestureEvent* event); | |
|
tdanderson
2017/07/17 22:44:38
Please add some documentation here for this new fu
minch1
2017/07/18 03:59:00
Done.
| |
| 87 | 88 |
| 88 private: | 89 private: |
| 89 DISALLOW_COPY_AND_ASSIGN(Delegate); | 90 DISALLOW_COPY_AND_ASSIGN(Delegate); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 struct VIEWS_EXPORT InitParams { | 93 struct VIEWS_EXPORT InitParams { |
| 93 InitParams(); | 94 InitParams(); |
| 94 InitParams(const InitParams& other); | 95 InitParams(const InitParams& other); |
| 95 Delegate* delegate = nullptr; | 96 Delegate* delegate = nullptr; |
| 96 gfx::NativeWindow parent_window = nullptr; | 97 gfx::NativeWindow parent_window = nullptr; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 Widget* bubble_widget) const override; | 152 Widget* bubble_widget) const override; |
| 152 void OnWidgetClosing(Widget* widget) override; | 153 void OnWidgetClosing(Widget* widget) override; |
| 153 | 154 |
| 154 // Overridden from views::View. | 155 // Overridden from views::View. |
| 155 gfx::Size CalculatePreferredSize() const override; | 156 gfx::Size CalculatePreferredSize() const override; |
| 156 gfx::Size GetMaximumSize() const override; | 157 gfx::Size GetMaximumSize() const override; |
| 157 int GetHeightForWidth(int width) const override; | 158 int GetHeightForWidth(int width) const override; |
| 158 void OnMouseEntered(const ui::MouseEvent& event) override; | 159 void OnMouseEntered(const ui::MouseEvent& event) override; |
| 159 void OnMouseExited(const ui::MouseEvent& event) override; | 160 void OnMouseExited(const ui::MouseEvent& event) override; |
| 160 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; | 161 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 162 void OnGestureEvent(ui::GestureEvent* event) override; | |
| 161 | 163 |
| 162 // Overridden from MouseWatcherListener | 164 // Overridden from MouseWatcherListener |
| 163 void MouseMovedOutOfHost() override; | 165 void MouseMovedOutOfHost() override; |
| 164 | 166 |
| 165 // Overridden from ui::AcceleratorTarget | 167 // Overridden from ui::AcceleratorTarget |
| 166 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 168 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 167 | 169 |
| 168 protected: | 170 protected: |
| 169 // Overridden from views::BubbleDialogDelegateView. | 171 // Overridden from views::BubbleDialogDelegateView. |
| 170 int GetDialogButtons() const override; | 172 int GetDialogButtons() const override; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 199 | 201 |
| 200 // Used to find any mouse movements. | 202 // Used to find any mouse movements. |
| 201 std::unique_ptr<MouseWatcher> mouse_watcher_; | 203 std::unique_ptr<MouseWatcher> mouse_watcher_; |
| 202 | 204 |
| 203 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); | 205 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); |
| 204 }; | 206 }; |
| 205 | 207 |
| 206 } // namespace views | 208 } // namespace views |
| 207 | 209 |
| 208 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 210 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
| OLD | NEW |