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 ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/common/login_status.h" | 10 #include "ash/common/login_status.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class Label; | 25 class Label; |
26 class LabelButton; | 26 class LabelButton; |
27 class Painter; | 27 class Painter; |
28 class Separator; | 28 class Separator; |
29 class Slider; | 29 class Slider; |
30 class SliderListener; | 30 class SliderListener; |
31 class ToggleButton; | 31 class ToggleButton; |
32 } // namespace views | 32 } // namespace views |
33 | 33 |
34 namespace ash { | 34 namespace ash { |
| 35 class HoverHighlightView; |
35 | 36 |
36 // Factory/utility functions used by the system menu. | 37 // Factory/utility functions used by the system menu. |
37 class TrayPopupUtils { | 38 class TrayPopupUtils { |
38 public: | 39 public: |
39 // Creates a default container view to be used by system menu rows that are | 40 // Creates a default container view to be used by system menu rows that are |
40 // either a single targetable area or not targetable at all. The caller takes | 41 // either a single targetable area or not targetable at all. The caller takes |
41 // over ownership of the created view. | 42 // over ownership of the created view. |
42 // | 43 // |
43 // The returned view consists of 3 regions: START, CENTER, and END. Any child | 44 // The returned view consists of 3 regions: START, CENTER, and END. Any child |
44 // Views added to the START and END containers will be added horizontally and | 45 // Views added to the START and END containers will be added horizontally and |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Creates and returns a horizontal separator line to be drawn between rows | 197 // Creates and returns a horizontal separator line to be drawn between rows |
197 // in a detailed view above the sub-header rows. Caller assumes ownership of | 198 // in a detailed view above the sub-header rows. Caller assumes ownership of |
198 // the returned separator. | 199 // the returned separator. |
199 static views::Separator* CreateListSubHeaderSeparator(); | 200 static views::Separator* CreateListSubHeaderSeparator(); |
200 | 201 |
201 // Returns true if it is possible to open WebUI settings in a browser window, | 202 // Returns true if it is possible to open WebUI settings in a browser window, |
202 // i.e., the user is logged in, not on the lock screen, and not in a secondary | 203 // i.e., the user is logged in, not on the lock screen, and not in a secondary |
203 // account flow. | 204 // account flow. |
204 static bool CanOpenWebUISettings(LoginStatus status); | 205 static bool CanOpenWebUISettings(LoginStatus status); |
205 | 206 |
| 207 // Initializes a row in the system menu as checkable and update the check mark |
| 208 // status of this row. |
| 209 static void InitializeAsCheckableRow(HoverHighlightView* container, |
| 210 bool checked); |
| 211 |
| 212 // Updates the visibility and a11y state of the checkable row |container|. |
| 213 static void UpdateCheckMarkVisibility(HoverHighlightView* container, |
| 214 bool visible); |
| 215 |
206 private: | 216 private: |
207 // Returns the effective ink drop insets for |host| according to the | 217 // Returns the effective ink drop insets for |host| according to the |
208 // |ink_drop_style|. | 218 // |ink_drop_style|. |
209 static gfx::Insets GetInkDropInsets(TrayPopupInkDropStyle ink_drop_style); | 219 static gfx::Insets GetInkDropInsets(TrayPopupInkDropStyle ink_drop_style); |
210 | 220 |
211 // Returns the effective ink drop bounds for |host| according to the | 221 // Returns the effective ink drop bounds for |host| according to the |
212 // |ink_drop_style|. | 222 // |ink_drop_style|. |
213 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, | 223 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, |
214 const views::View* host); | 224 const views::View* host); |
215 | 225 |
216 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); | 226 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); |
217 }; | 227 }; |
218 | 228 |
219 } // namespace ash | 229 } // namespace ash |
220 | 230 |
221 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 231 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
OLD | NEW |