| 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 "ash/common/login_status.h" | 8 #include "ash/common/login_status.h" |
| 9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
| 10 #include "ash/common/system/tray/tray_popup_ink_drop_style.h" | 10 #include "ash/common/system/tray/tray_popup_ink_drop_style.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // The returned view consists of 3 regions: START, CENTER, and END. Any child | 39 // The returned view consists of 3 regions: START, CENTER, and END. Any child |
| 40 // Views added to the START and END containers will be added horizontally and | 40 // Views added to the START and END containers will be added horizontally and |
| 41 // any Views added to the CENTER container will be added vertically. | 41 // any Views added to the CENTER container will be added vertically. |
| 42 // | 42 // |
| 43 // The START and END containers have a fixed minimum width but can grow into | 43 // The START and END containers have a fixed minimum width but can grow into |
| 44 // the CENTER container if space is required and available. | 44 // the CENTER container if space is required and available. |
| 45 // | 45 // |
| 46 // The CENTER container has a flexible width. | 46 // The CENTER container has a flexible width. |
| 47 static TriView* CreateDefaultRowView(); | 47 static TriView* CreateDefaultRowView(); |
| 48 | 48 |
| 49 // Creates a container view to be used by system menu sub-section header rows. |
| 50 // The caller takes over ownership of the created view. |
| 51 // |
| 52 // The returned view consists of 2 regions: CENTER, and END having the same |
| 53 // properties as when using |CreateMultiTargetRowView|. The START container is |
| 54 // hidden. |
| 55 // The END container has a fixed minimum width but can grow into the CENTER |
| 56 // container if space is required and available. The CENTER container has a |
| 57 // flexible width. |
| 58 static TriView* CreateSubHeaderRowView(); |
| 59 |
| 49 // Creates a container view to be used by system menu rows that want to embed | 60 // Creates a container view to be used by system menu rows that want to embed |
| 50 // a targetable area within one (or more) of the containers OR by any row | 61 // a targetable area within one (or more) of the containers OR by any row |
| 51 // that requires a non-default layout within the container views. The returned | 62 // that requires a non-default layout within the container views. The returned |
| 52 // view will have the following configurations: | 63 // view will have the following configurations: |
| 53 // - default minimum row height | 64 // - default minimum row height |
| 54 // - default minimum width for the START and END containers | 65 // - default minimum width for the START and END containers |
| 55 // - default left and right insets | 66 // - default left and right insets |
| 56 // - default container flex values | 67 // - default container flex values |
| 57 // - Each container view will have a FillLayout installed on it | 68 // - Each container view will have a FillLayout installed on it |
| 58 // | 69 // |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 static std::unique_ptr<views::InkDropMask> CreateInkDropMask( | 173 static std::unique_ptr<views::InkDropMask> CreateInkDropMask( |
| 163 TrayPopupInkDropStyle ink_drop_style, | 174 TrayPopupInkDropStyle ink_drop_style, |
| 164 const views::View* host); | 175 const views::View* host); |
| 165 | 176 |
| 166 // Creates and returns a horizontal separator line to be drawn between rows | 177 // Creates and returns a horizontal separator line to be drawn between rows |
| 167 // in a detailed view. If |left_inset| is true, then the separator is inset on | 178 // in a detailed view. If |left_inset| is true, then the separator is inset on |
| 168 // the left by the width normally occupied by an icon. Caller assumes | 179 // the left by the width normally occupied by an icon. Caller assumes |
| 169 // ownership of the returned separator. | 180 // ownership of the returned separator. |
| 170 static views::Separator* CreateListItemSeparator(bool left_inset); | 181 static views::Separator* CreateListItemSeparator(bool left_inset); |
| 171 | 182 |
| 183 // Creates and returns a horizontal separator line to be drawn between rows |
| 184 // in a detailed view above the sub-header rows. Caller assumes ownership of |
| 185 // the returned separator. |
| 186 static views::Separator* CreateListSubHeaderSeparator(); |
| 187 |
| 172 // Returns true if it is possible to open WebUI settings in a browser window, | 188 // Returns true if it is possible to open WebUI settings in a browser window, |
| 173 // i.e., the user is logged in, not on the lock screen, and not in a secondary | 189 // i.e., the user is logged in, not on the lock screen, and not in a secondary |
| 174 // account flow. | 190 // account flow. |
| 175 static bool CanOpenWebUISettings(LoginStatus status); | 191 static bool CanOpenWebUISettings(LoginStatus status); |
| 176 | 192 |
| 177 private: | 193 private: |
| 178 // Returns the effective ink drop insets for |host| according to the | 194 // Returns the effective ink drop insets for |host| according to the |
| 179 // |ink_drop_style|. | 195 // |ink_drop_style|. |
| 180 static gfx::Insets GetInkDropInsets(TrayPopupInkDropStyle ink_drop_style); | 196 static gfx::Insets GetInkDropInsets(TrayPopupInkDropStyle ink_drop_style); |
| 181 | 197 |
| 182 // Returns the effective ink drop bounds for |host| according to the | 198 // Returns the effective ink drop bounds for |host| according to the |
| 183 // |ink_drop_style|. | 199 // |ink_drop_style|. |
| 184 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, | 200 static gfx::Rect GetInkDropBounds(TrayPopupInkDropStyle ink_drop_style, |
| 185 const views::View* host); | 201 const views::View* host); |
| 186 | 202 |
| 187 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); | 203 DISALLOW_IMPLICIT_CONSTRUCTORS(TrayPopupUtils); |
| 188 }; | 204 }; |
| 189 | 205 |
| 190 } // namespace ash | 206 } // namespace ash |
| 191 | 207 |
| 192 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ | 208 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ |
| OLD | NEW |