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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/views/bubble/bubble_delegate.h" | 9 #include "ui/views/bubble/bubble_delegate.h" |
10 #include "ui/views/mouse_watcher.h" | 10 #include "ui/views/mouse_watcher.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // the user to enter the view. | 68 // the user to enter the view. |
69 virtual void OnMouseEnteredView() = 0; | 69 virtual void OnMouseEnteredView() = 0; |
70 virtual void OnMouseExitedView() = 0; | 70 virtual void OnMouseExitedView() = 0; |
71 | 71 |
72 // Called from GetAccessibleState(); should return the appropriate | 72 // Called from GetAccessibleState(); should return the appropriate |
73 // accessible name for the bubble. | 73 // accessible name for the bubble. |
74 virtual base::string16 GetAccessibleNameForBubble() = 0; | 74 virtual base::string16 GetAccessibleNameForBubble() = 0; |
75 | 75 |
76 // Passes responsibility for BubbleDelegateView::GetAnchorRect to the | 76 // Passes responsibility for BubbleDelegateView::GetAnchorRect to the |
77 // delegate. | 77 // delegate. |
78 virtual gfx::Rect GetAnchorRect(views::Widget* anchor_widget, | 78 virtual gfx::Rect GetAnchorRect( |
79 AnchorType anchor_type, | 79 views::Widget* anchor_widget, |
80 AnchorAlignment anchor_alignment) = 0; | 80 AnchorType anchor_type, |
| 81 AnchorAlignment anchor_alignment) const = 0; |
81 | 82 |
82 // 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 |
83 // child view was closed). | 84 // child view was closed). |
84 virtual void HideBubble(const TrayBubbleView* bubble_view) = 0; | 85 virtual void HideBubble(const TrayBubbleView* bubble_view) = 0; |
85 | 86 |
86 private: | 87 private: |
87 DISALLOW_COPY_AND_ASSIGN(Delegate); | 88 DISALLOW_COPY_AND_ASSIGN(Delegate); |
88 }; | 89 }; |
89 | 90 |
90 struct VIEWS_EXPORT InitParams { | 91 struct VIEWS_EXPORT InitParams { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 bool is_gesture_dragging() const { return is_gesture_dragging_; } | 147 bool is_gesture_dragging() const { return is_gesture_dragging_; } |
147 | 148 |
148 // Overridden from views::WidgetDelegate. | 149 // Overridden from views::WidgetDelegate. |
149 virtual bool CanActivate() const OVERRIDE; | 150 virtual bool CanActivate() const OVERRIDE; |
150 virtual views::NonClientFrameView* CreateNonClientFrameView( | 151 virtual views::NonClientFrameView* CreateNonClientFrameView( |
151 views::Widget* widget) OVERRIDE; | 152 views::Widget* widget) OVERRIDE; |
152 virtual bool WidgetHasHitTestMask() const OVERRIDE; | 153 virtual bool WidgetHasHitTestMask() const OVERRIDE; |
153 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; | 154 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; |
154 | 155 |
155 // Overridden from views::BubbleDelegateView. | 156 // Overridden from views::BubbleDelegateView. |
156 virtual gfx::Rect GetAnchorRect() OVERRIDE; | 157 virtual gfx::Rect GetAnchorRect() const OVERRIDE; |
157 | 158 |
158 // Overridden from views::View. | 159 // Overridden from views::View. |
159 virtual gfx::Size GetPreferredSize() OVERRIDE; | 160 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
160 virtual gfx::Size GetMaximumSize() OVERRIDE; | 161 virtual gfx::Size GetMaximumSize() OVERRIDE; |
161 virtual int GetHeightForWidth(int width) OVERRIDE; | 162 virtual int GetHeightForWidth(int width) const OVERRIDE; |
162 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 163 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
163 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 164 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
164 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 165 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
165 | 166 |
166 // Overridden from MouseWatcherListener | 167 // Overridden from MouseWatcherListener |
167 virtual void MouseMovedOutOfHost() OVERRIDE; | 168 virtual void MouseMovedOutOfHost() OVERRIDE; |
168 | 169 |
169 protected: | 170 protected: |
170 TrayBubbleView(gfx::NativeView parent_window, | 171 TrayBubbleView(gfx::NativeView parent_window, |
171 views::View* anchor, | 172 views::View* anchor, |
(...skipping 22 matching lines...) Expand all Loading... |
194 | 195 |
195 // Used to find any mouse movements. | 196 // Used to find any mouse movements. |
196 scoped_ptr<MouseWatcher> mouse_watcher_; | 197 scoped_ptr<MouseWatcher> mouse_watcher_; |
197 | 198 |
198 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); | 199 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); |
199 }; | 200 }; |
200 | 201 |
201 } // namespace views | 202 } // namespace views |
202 | 203 |
203 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 204 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
OLD | NEW |