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_BUBBLE_DELEGATE_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "ui/views/bubble/bubble_border.h" | 9 #include "ui/views/bubble/bubble_border.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 public WidgetObserver { | 26 public WidgetObserver { |
27 public: | 27 public: |
28 BubbleDelegateView(); | 28 BubbleDelegateView(); |
29 BubbleDelegateView(View* anchor_view, BubbleBorder::Arrow arrow); | 29 BubbleDelegateView(View* anchor_view, BubbleBorder::Arrow arrow); |
30 virtual ~BubbleDelegateView(); | 30 virtual ~BubbleDelegateView(); |
31 | 31 |
32 // Create and initialize the bubble Widget(s) with proper bounds. | 32 // Create and initialize the bubble Widget(s) with proper bounds. |
33 static Widget* CreateBubble(BubbleDelegateView* bubble_delegate); | 33 static Widget* CreateBubble(BubbleDelegateView* bubble_delegate); |
34 | 34 |
35 // WidgetDelegateView overrides: | 35 // WidgetDelegateView overrides: |
36 virtual BubbleDelegateView* AsBubbleDelegate() OVERRIDE; | 36 virtual BubbleDelegateView* AsBubbleDelegate() override; |
37 virtual bool ShouldShowCloseButton() const OVERRIDE; | 37 virtual bool ShouldShowCloseButton() const override; |
38 virtual View* GetContentsView() OVERRIDE; | 38 virtual View* GetContentsView() override; |
39 virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget) OVERRIDE; | 39 virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget) override; |
40 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 40 virtual void GetAccessibleState(ui::AXViewState* state) override; |
41 | 41 |
42 // WidgetObserver overrides: | 42 // WidgetObserver overrides: |
43 virtual void OnWidgetDestroying(Widget* widget) OVERRIDE; | 43 virtual void OnWidgetDestroying(Widget* widget) override; |
44 virtual void OnWidgetVisibilityChanging(Widget* widget, bool visible) | 44 virtual void OnWidgetVisibilityChanging(Widget* widget, bool visible) |
45 OVERRIDE; | 45 override; |
46 virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) | 46 virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) |
47 OVERRIDE; | 47 override; |
48 virtual void OnWidgetActivationChanged(Widget* widget, bool active) OVERRIDE; | 48 virtual void OnWidgetActivationChanged(Widget* widget, bool active) override; |
49 virtual void OnWidgetBoundsChanged(Widget* widget, | 49 virtual void OnWidgetBoundsChanged(Widget* widget, |
50 const gfx::Rect& new_bounds) OVERRIDE; | 50 const gfx::Rect& new_bounds) override; |
51 | 51 |
52 bool close_on_esc() const { return close_on_esc_; } | 52 bool close_on_esc() const { return close_on_esc_; } |
53 void set_close_on_esc(bool close_on_esc) { close_on_esc_ = close_on_esc; } | 53 void set_close_on_esc(bool close_on_esc) { close_on_esc_ = close_on_esc; } |
54 | 54 |
55 bool close_on_deactivate() const { return close_on_deactivate_; } | 55 bool close_on_deactivate() const { return close_on_deactivate_; } |
56 void set_close_on_deactivate(bool close) { close_on_deactivate_ = close; } | 56 void set_close_on_deactivate(bool close) { close_on_deactivate_ = close; } |
57 | 57 |
58 View* GetAnchorView() const; | 58 View* GetAnchorView() const; |
59 Widget* anchor_widget() const { return anchor_widget_; } | 59 Widget* anchor_widget() const { return anchor_widget_; } |
60 | 60 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 protected: | 113 protected: |
114 // Get bubble bounds from the anchor rect and client view's preferred size. | 114 // Get bubble bounds from the anchor rect and client view's preferred size. |
115 virtual gfx::Rect GetBubbleBounds(); | 115 virtual gfx::Rect GetBubbleBounds(); |
116 | 116 |
117 // Return a FontList to use for the title of the bubble. | 117 // Return a FontList to use for the title of the bubble. |
118 // (The default is MediumFont). | 118 // (The default is MediumFont). |
119 virtual const gfx::FontList& GetTitleFontList() const; | 119 virtual const gfx::FontList& GetTitleFontList() const; |
120 | 120 |
121 // View overrides: | 121 // View overrides: |
122 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 122 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
123 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; | 123 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
124 | 124 |
125 // Perform view initialization on the contents for bubble sizing. | 125 // Perform view initialization on the contents for bubble sizing. |
126 virtual void Init(); | 126 virtual void Init(); |
127 | 127 |
128 // Sets the anchor view or rect and repositions the bubble. Note that if a | 128 // Sets the anchor view or rect and repositions the bubble. Note that if a |
129 // valid view gets passed, the anchor rect will get ignored. If the view gets | 129 // valid view gets passed, the anchor rect will get ignored. If the view gets |
130 // deleted, but no new view gets set, the last known anchor postion will get | 130 // deleted, but no new view gets set, the last known anchor postion will get |
131 // returned. | 131 // returned. |
132 void SetAnchorView(View* anchor_view); | 132 void SetAnchorView(View* anchor_view); |
133 void SetAnchorRect(const gfx::Rect& rect); | 133 void SetAnchorRect(const gfx::Rect& rect); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 // Parent native window of the bubble. | 190 // Parent native window of the bubble. |
191 gfx::NativeView parent_window_; | 191 gfx::NativeView parent_window_; |
192 | 192 |
193 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); | 193 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); |
194 }; | 194 }; |
195 | 195 |
196 } // namespace views | 196 } // namespace views |
197 | 197 |
198 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 198 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
OLD | NEW |