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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/optional.h" |
11 #include "ui/views/bubble/bubble_dialog_delegate.h" | 12 #include "ui/views/bubble/bubble_dialog_delegate.h" |
12 #include "ui/views/mouse_watcher.h" | 13 #include "ui/views/mouse_watcher.h" |
13 #include "ui/views/views_export.h" | 14 #include "ui/views/views_export.h" |
14 | 15 |
15 namespace views { | 16 namespace views { |
16 class BoxLayout; | 17 class BoxLayout; |
17 class View; | 18 class View; |
18 class Widget; | 19 class Widget; |
19 } | 20 } |
20 | 21 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 77 |
77 struct VIEWS_EXPORT InitParams { | 78 struct VIEWS_EXPORT InitParams { |
78 InitParams(AnchorAlignment anchor_alignment, int min_width, int max_width); | 79 InitParams(AnchorAlignment anchor_alignment, int min_width, int max_width); |
79 InitParams(const InitParams& other); | 80 InitParams(const InitParams& other); |
80 AnchorAlignment anchor_alignment; | 81 AnchorAlignment anchor_alignment; |
81 int min_width; | 82 int min_width; |
82 int max_width; | 83 int max_width; |
83 int max_height; | 84 int max_height; |
84 bool can_activate; | 85 bool can_activate; |
85 bool close_on_deactivate; | 86 bool close_on_deactivate; |
86 SkColor bg_color; | 87 // If not provided, the bg color will be derived from the NativeTheme. |
| 88 base::Optional<SkColor> bg_color; |
87 }; | 89 }; |
88 | 90 |
89 // Constructs and returns a TrayBubbleView. |init_params| may be modified. | 91 // Constructs and returns a TrayBubbleView. |init_params| may be modified. |
90 static TrayBubbleView* Create(views::View* anchor, | 92 static TrayBubbleView* Create(views::View* anchor, |
91 Delegate* delegate, | 93 Delegate* delegate, |
92 InitParams* init_params); | 94 InitParams* init_params); |
93 | 95 |
94 ~TrayBubbleView() override; | 96 ~TrayBubbleView() override; |
95 | 97 |
96 // Returns whether a tray bubble is active. | 98 // Returns whether a tray bubble is active. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 179 |
178 // Used to find any mouse movements. | 180 // Used to find any mouse movements. |
179 std::unique_ptr<MouseWatcher> mouse_watcher_; | 181 std::unique_ptr<MouseWatcher> mouse_watcher_; |
180 | 182 |
181 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); | 183 DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); |
182 }; | 184 }; |
183 | 185 |
184 } // namespace views | 186 } // namespace views |
185 | 187 |
186 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ | 188 #endif // UI_VIEWS_BUBBLE_TRAY_BUBBLE_VIEW_H_ |
OLD | NEW |