| 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 ASH_COMMON_SYSTEM_TRAY_TRAY_UTILS_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_UTILS_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_UTILS_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_UTILS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/login_status.h" |
| 10 #include "ash/public/cpp/shelf_types.h" | 11 #include "ash/public/cpp/shelf_types.h" |
| 11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 12 | 13 |
| 13 namespace views { | 14 namespace views { |
| 14 class Label; | 15 class Label; |
| 15 class View; | 16 class View; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace ash { | 19 namespace ash { |
| 19 | 20 |
| 20 class TrayItemView; | 21 class TrayItemView; |
| 21 | 22 |
| 22 // Sets up a Label properly for the tray (sets color, font etc.). | 23 // Sets up a Label properly for the tray (sets color, font etc.). |
| 23 void SetupLabelForTray(views::Label* label); | 24 void SetupLabelForTray(views::Label* label); |
| 24 | 25 |
| 25 // TODO(jennyz): refactor these two functions to SystemTrayItem. | 26 // TODO(jennyz): refactor these two functions to SystemTrayItem. |
| 26 // Sets the empty border of an image tray item for adjusting the space | 27 // Sets the empty border of an image tray item for adjusting the space |
| 27 // around it. | 28 // around it. |
| 28 void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment); | 29 void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment); |
| 29 // Sets the empty border around a label tray item for adjusting the space | 30 // Sets the empty border around a label tray item for adjusting the space |
| 30 // around it. | 31 // around it. |
| 31 void SetTrayLabelItemBorder(TrayItemView* tray_view, ShelfAlignment alignment); | 32 void SetTrayLabelItemBorder(TrayItemView* tray_view, ShelfAlignment alignment); |
| 32 | 33 |
| 33 // Computes an accessible label for this button based on all descendant view | 34 // Computes an accessible label for this button based on all descendant view |
| 34 // labels by concatenating them in depth-first order. | 35 // labels by concatenating them in depth-first order. |
| 35 void GetAccessibleLabelFromDescendantViews( | 36 void GetAccessibleLabelFromDescendantViews( |
| 36 views::View* view, | 37 views::View* view, |
| 37 std::vector<base::string16>& out_labels); | 38 std::vector<base::string16>& out_labels); |
| 38 | 39 |
| 40 // Returns true if it is possible to open WebUI settings in a browser window, |
| 41 // i.e., the user is logged in, not on the lock screen, and not in a secondary |
| 42 // account flow. |
| 43 bool CanOpenWebUISettings(LoginStatus status); |
| 44 |
| 39 } // namespace ash | 45 } // namespace ash |
| 40 | 46 |
| 41 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_UTILS_H_ | 47 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_UTILS_H_ |
| OLD | NEW |