| 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" |
| 11 #include "ui/views/widget/widget_delegate.h" | 11 #include "ui/views/widget/widget_delegate.h" |
| 12 #include "ui/views/widget/widget_observer.h" | 12 #include "ui/views/widget/widget_observer.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class FontList; |
| 15 class Rect; | 16 class Rect; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace views { | 19 namespace views { |
| 19 | 20 |
| 20 class BubbleFrameView; | 21 class BubbleFrameView; |
| 21 | 22 |
| 22 // BubbleDelegateView creates frame and client views for bubble Widgets. | 23 // BubbleDelegateView creates frame and client views for bubble Widgets. |
| 23 // BubbleDelegateView itself is the client's contents view. | 24 // BubbleDelegateView itself is the client's contents view. |
| 24 class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, | 25 class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 111 |
| 111 // Call this method when the anchor bounds have changed to reposition the | 112 // Call this method when the anchor bounds have changed to reposition the |
| 112 // bubble. The bubble is automatically repositioned when the anchor view | 113 // bubble. The bubble is automatically repositioned when the anchor view |
| 113 // bounds change as a result of the widget's bounds changing. | 114 // bounds change as a result of the widget's bounds changing. |
| 114 void OnAnchorBoundsChanged(); | 115 void OnAnchorBoundsChanged(); |
| 115 | 116 |
| 116 protected: | 117 protected: |
| 117 // Get bubble bounds from the anchor rect and client view's preferred size. | 118 // Get bubble bounds from the anchor rect and client view's preferred size. |
| 118 virtual gfx::Rect GetBubbleBounds(); | 119 virtual gfx::Rect GetBubbleBounds(); |
| 119 | 120 |
| 121 // Return a FontList to use for the title of the bubble. |
| 122 // (The default is MediumFont). |
| 123 virtual const gfx::FontList& GetTitleFontList() const; |
| 124 |
| 120 // View overrides: | 125 // View overrides: |
| 121 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 126 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 122 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; | 127 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; |
| 123 | 128 |
| 124 // Perform view initialization on the contents for bubble sizing. | 129 // Perform view initialization on the contents for bubble sizing. |
| 125 virtual void Init(); | 130 virtual void Init(); |
| 126 | 131 |
| 127 // Sets the anchor view or rect and repositions the bubble. Note that if a | 132 // Sets the anchor view or rect and repositions the bubble. Note that if a |
| 128 // valid view gets passed, the anchor rect will get ignored. If the view gets | 133 // valid view gets passed, the anchor rect will get ignored. If the view gets |
| 129 // deleted, but no new view gets set, the last known anchor postion will get | 134 // deleted, but no new view gets set, the last known anchor postion will get |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 196 |
| 192 // Parent native window of the bubble. | 197 // Parent native window of the bubble. |
| 193 gfx::NativeView parent_window_; | 198 gfx::NativeView parent_window_; |
| 194 | 199 |
| 195 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); | 200 DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView); |
| 196 }; | 201 }; |
| 197 | 202 |
| 198 } // namespace views | 203 } // namespace views |
| 199 | 204 |
| 200 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 205 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
| OLD | NEW |