| 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_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
| 6 #define ASH_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 6 #define ASH_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/login_status.h" | 10 #include "ash/login_status.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // the left by the width normally occupied by an icon. Caller assumes | 193 // the left by the width normally occupied by an icon. Caller assumes |
| 194 // ownership of the returned separator. | 194 // ownership of the returned separator. |
| 195 static views::Separator* CreateListItemSeparator(bool left_inset); | 195 static views::Separator* CreateListItemSeparator(bool left_inset); |
| 196 | 196 |
| 197 // 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 |
| 198 // 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 |
| 199 // the returned separator. | 199 // the returned separator. |
| 200 static views::Separator* CreateListSubHeaderSeparator(); | 200 static views::Separator* CreateListSubHeaderSeparator(); |
| 201 | 201 |
| 202 // 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, |
| 203 // 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, not adding a secondary |
| 204 // account flow. | 204 // user, and not in the supervised user creation flow. |
| 205 static bool CanOpenWebUISettings(LoginStatus status); | 205 static bool CanOpenWebUISettings(); |
| 206 | 206 |
| 207 // Initializes a row in the system menu as checkable and update the check mark | 207 // Initializes a row in the system menu as checkable and update the check mark |
| 208 // status of this row. | 208 // status of this row. |
| 209 static void InitializeAsCheckableRow(HoverHighlightView* container, | 209 static void InitializeAsCheckableRow(HoverHighlightView* container, |
| 210 bool checked); | 210 bool checked); |
| 211 | 211 |
| 212 // Updates the visibility and a11y state of the checkable row |container|. | 212 // Updates the visibility and a11y state of the checkable row |container|. |
| 213 static void UpdateCheckMarkVisibility(HoverHighlightView* container, | 213 static void UpdateCheckMarkVisibility(HoverHighlightView* container, |
| 214 bool visible); | 214 bool visible); |
| 215 | 215 |
| 216 private: | 216 private: |
| 217 // Returns the effective ink drop insets for |host| according to the | 217 // Returns the effective ink drop insets for |host| according to the |
| 218 // |ink_drop_style|. | 218 // |ink_drop_style|. |
| 219 static gfx::Insets GetInkDropInsets(TrayPopupInkDropStyle ink_drop_style); | 219 static gfx::Insets GetInkDropInsets(TrayPopupInkDropStyle ink_drop_style); |
| 220 | 220 |
| 221 // Returns the effective ink drop bounds for |host| according to the | 221 // Returns the effective ink drop bounds for |host| according to the |
| 222 // |ink_drop_style|. | 222 // |ink_drop_style|. |
| 223 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, | 223 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, |
| 224 const views::View* host); | 224 const views::View* host); |
| 225 | 225 |
| 226 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); | 226 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 } // namespace ash | 229 } // namespace ash |
| 230 | 230 |
| 231 #endif // ASH_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 231 #endif // ASH_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
| OLD | NEW |