OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_DIALOG_DELEGATE_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "ui/views/bubble/bubble_border.h" | 12 #include "ui/views/bubble/bubble_border.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
14 #include "ui/views/widget/widget_observer.h" | 14 #include "ui/views/widget/widget_observer.h" |
15 #include "ui/views/window/dialog_delegate.h" | 15 #include "ui/views/window/dialog_delegate.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 class FontList; | |
19 class Rect; | 18 class Rect; |
20 } | 19 } |
21 | 20 |
22 namespace views { | 21 namespace views { |
23 | 22 |
24 class BubbleFrameView; | 23 class BubbleFrameView; |
25 class ViewTracker; | 24 class ViewTracker; |
26 | 25 |
27 // BubbleDialogDelegateView is a special DialogDelegateView for bubbles. | 26 // BubbleDialogDelegateView is a special DialogDelegateView for bubbles. |
28 class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView, | 27 class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // bounds change as a result of the widget's bounds changing. | 122 // bounds change as a result of the widget's bounds changing. |
124 void OnAnchorBoundsChanged(); | 123 void OnAnchorBoundsChanged(); |
125 | 124 |
126 protected: | 125 protected: |
127 BubbleDialogDelegateView(); | 126 BubbleDialogDelegateView(); |
128 BubbleDialogDelegateView(View* anchor_view, BubbleBorder::Arrow arrow); | 127 BubbleDialogDelegateView(View* anchor_view, BubbleBorder::Arrow arrow); |
129 | 128 |
130 // Get bubble bounds from the anchor rect and client view's preferred size. | 129 // Get bubble bounds from the anchor rect and client view's preferred size. |
131 virtual gfx::Rect GetBubbleBounds(); | 130 virtual gfx::Rect GetBubbleBounds(); |
132 | 131 |
133 // Return a FontList to use for the title of the bubble. | |
134 // (The default is MediumFont). | |
135 virtual const gfx::FontList& GetTitleFontList() const; | |
136 | |
137 // View overrides: | 132 // View overrides: |
138 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 133 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
139 | 134 |
140 // Perform view initialization on the contents for bubble sizing. | 135 // Perform view initialization on the contents for bubble sizing. |
141 virtual void Init(); | 136 virtual void Init(); |
142 | 137 |
143 // Sets the anchor view or rect and repositions the bubble. Note that if a | 138 // Sets the anchor view or rect and repositions the bubble. Note that if a |
144 // valid view gets passed, the anchor rect will get ignored. If the view gets | 139 // valid view gets passed, the anchor rect will get ignored. If the view gets |
145 // deleted, but no new view gets set, the last known anchor postion will get | 140 // deleted, but no new view gets set, the last known anchor postion will get |
146 // returned. | 141 // returned. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 204 |
210 // Parent native window of the bubble. | 205 // Parent native window of the bubble. |
211 gfx::NativeView parent_window_; | 206 gfx::NativeView parent_window_; |
212 | 207 |
213 DISALLOW_COPY_AND_ASSIGN(BubbleDialogDelegateView); | 208 DISALLOW_COPY_AND_ASSIGN(BubbleDialogDelegateView); |
214 }; | 209 }; |
215 | 210 |
216 } // namespace views | 211 } // namespace views |
217 | 212 |
218 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE2_H_ | 213 #endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE2_H_ |
OLD | NEW |