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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 // Called when the delegate is destroyed. | 141 // Called when the delegate is destroyed. |
142 void reset_delegate() { delegate_ = NULL; } | 142 void reset_delegate() { delegate_ = NULL; } |
143 | 143 |
144 Delegate* delegate() { return delegate_; } | 144 Delegate* delegate() { return delegate_; } |
145 | 145 |
146 void set_gesture_dragging(bool dragging) { is_gesture_dragging_ = dragging; } | 146 void set_gesture_dragging(bool dragging) { is_gesture_dragging_ = dragging; } |
147 bool is_gesture_dragging() const { return is_gesture_dragging_; } | 147 bool is_gesture_dragging() const { return is_gesture_dragging_; } |
148 | 148 |
149 // Overridden from views::WidgetDelegate. | 149 // Overridden from views::WidgetDelegate. |
150 virtual bool CanActivate() const OVERRIDE; | 150 virtual bool CanActivate() const override; |
151 virtual views::NonClientFrameView* CreateNonClientFrameView( | 151 virtual views::NonClientFrameView* CreateNonClientFrameView( |
152 views::Widget* widget) OVERRIDE; | 152 views::Widget* widget) override; |
153 virtual bool WidgetHasHitTestMask() const OVERRIDE; | 153 virtual bool WidgetHasHitTestMask() const override; |
154 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; | 154 virtual void GetWidgetHitTestMask(gfx::Path* mask) const override; |
155 | 155 |
156 // Overridden from views::BubbleDelegateView. | 156 // Overridden from views::BubbleDelegateView. |
157 virtual gfx::Rect GetAnchorRect() const OVERRIDE; | 157 virtual gfx::Rect GetAnchorRect() const override; |
158 | 158 |
159 // Overridden from views::View. | 159 // Overridden from views::View. |
160 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 160 virtual gfx::Size GetPreferredSize() const override; |
161 virtual gfx::Size GetMaximumSize() const OVERRIDE; | 161 virtual gfx::Size GetMaximumSize() const override; |
162 virtual int GetHeightForWidth(int width) const OVERRIDE; | 162 virtual int GetHeightForWidth(int width) const override; |
163 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 163 virtual void OnMouseEntered(const ui::MouseEvent& event) override; |
164 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 164 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
165 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 165 virtual void GetAccessibleState(ui::AXViewState* state) override; |
166 | 166 |
167 // Overridden from MouseWatcherListener | 167 // Overridden from MouseWatcherListener |
168 virtual void MouseMovedOutOfHost() OVERRIDE; | 168 virtual void MouseMovedOutOfHost() override; |
169 | 169 |
170 protected: | 170 protected: |
171 TrayBubbleView(gfx::NativeView parent_window, | 171 TrayBubbleView(gfx::NativeView parent_window, |
172 views::View* anchor, | 172 views::View* anchor, |
173 Delegate* delegate, | 173 Delegate* delegate, |
174 const InitParams& init_params); | 174 const InitParams& init_params); |
175 | 175 |
176 // Overridden from views::BubbleDelegateView. | 176 // Overridden from views::BubbleDelegateView. |
177 virtual void Init() OVERRIDE; | 177 virtual void Init() override; |
178 | 178 |
179 // Overridden from views::View. | 179 // Overridden from views::View. |
180 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; | 180 virtual void ChildPreferredSizeChanged(View* child) override; |
181 virtual void ViewHierarchyChanged( | 181 virtual void ViewHierarchyChanged( |
182 const ViewHierarchyChangedDetails& details) OVERRIDE; | 182 const ViewHierarchyChangedDetails& details) override; |
183 | 183 |
184 private: | 184 private: |
185 InitParams params_; | 185 InitParams params_; |
186 Delegate* delegate_; | 186 Delegate* delegate_; |
187 int preferred_width_; | 187 int preferred_width_; |
188 internal::TrayBubbleBorder* bubble_border_; | 188 internal::TrayBubbleBorder* bubble_border_; |
189 scoped_ptr<internal::TrayBubbleContentMask> bubble_content_mask_; | 189 scoped_ptr<internal::TrayBubbleContentMask> bubble_content_mask_; |
190 bool is_gesture_dragging_; | 190 bool is_gesture_dragging_; |
191 | 191 |
192 // True once the mouse cursor was actively moved by the user over the bubble. | 192 // True once the mouse cursor was actively moved by the user over the bubble. |
193 // Only then the OnMouseExitedView() event will get passed on to listeners. | 193 // Only then the OnMouseExitedView() event will get passed on to listeners. |
194 bool mouse_actively_entered_; | 194 bool mouse_actively_entered_; |
195 | 195 |
196 // Used to find any mouse movements. | 196 // Used to find any mouse movements. |
197 scoped_ptr<MouseWatcher> mouse_watcher_; | 197 scoped_ptr<MouseWatcher> mouse_watcher_; |
198 | 198 |
199 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); | 199 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); |
200 }; | 200 }; |
201 | 201 |
202 } // namespace views | 202 } // namespace views |
203 | 203 |
204 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 204 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
OLD | NEW |