Chromium Code Reviews| 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_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ | 5 #ifndef ASH_COMMON_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ |
| 6 #define ASH_COMMON_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ | 6 #define ASH_COMMON_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 | 12 |
| 13 namespace test { | 13 // TODO(estade): deprecated, remove: crbug.com/690048 |
|
tdanderson
2017/02/13 17:36:28
optionally also cite crbug.com/690957
Evan Stade
2017/02/13 19:29:42
Done.
| |
| 14 class MaterialDesignControllerTestAPI; | |
| 15 } // namespace test | |
| 16 | |
| 17 // Central controller to handle material design modes. | |
| 18 class ASH_EXPORT MaterialDesignController { | 14 class ASH_EXPORT MaterialDesignController { |
| 19 public: | 15 public: |
| 20 // The different material design modes for Chrome OS system UI. | 16 // Returns true. |
| 21 enum Mode { | |
| 22 // Not initialized. | |
| 23 UNINITIALIZED = -1, | |
| 24 // Classic, non-material design. | |
| 25 NON_MATERIAL = 0, | |
| 26 // Basic material design. | |
| 27 MATERIAL_NORMAL = 1, | |
| 28 // Material design with experimental features. | |
| 29 MATERIAL_EXPERIMENTAL = 2 | |
| 30 }; | |
| 31 | |
| 32 // Initializes |mode_|. Must be called before calling IsMaterial(), | |
| 33 // IsMaterialExperimental(), IsMaterialNormal(), or GetMode(). | |
| 34 static void Initialize(); | |
| 35 | |
| 36 // Returns the currently initialized MaterialDesignController::Mode type for | |
| 37 // Chrome OS system UI. | |
| 38 static Mode GetMode(); | |
| 39 | |
| 40 // Returns true if Material Design features are enabled for Chrome OS shelf. | |
| 41 static bool IsShelfMaterial(); | 17 static bool IsShelfMaterial(); |
| 42 | 18 |
| 43 // Returns true if Material Design features are enabled for Chrome OS | 19 // Returns true. |
| 44 // immersive mode. | |
| 45 static bool IsImmersiveModeMaterial(); | 20 static bool IsImmersiveModeMaterial(); |
| 46 | 21 |
| 47 // Returns true if Material Design features are enabled for Chrome OS system | 22 // Returns true. |
| 48 // tray menu. | |
| 49 static bool IsSystemTrayMenuMaterial(); | 23 static bool IsSystemTrayMenuMaterial(); |
| 50 | 24 |
| 51 // Returns true if material design versions of icons should be used in the | 25 // Returns true. |
| 52 // status tray and system menu. | |
| 53 static bool UseMaterialDesignSystemIcons(); | 26 static bool UseMaterialDesignSystemIcons(); |
| 54 | 27 |
| 55 private: | 28 private: |
| 56 friend class test::MaterialDesignControllerTestAPI; | |
| 57 | |
| 58 // Declarations only. Do not allow construction of an object. | 29 // Declarations only. Do not allow construction of an object. |
| 59 MaterialDesignController(); | 30 MaterialDesignController(); |
| 60 ~MaterialDesignController(); | 31 ~MaterialDesignController(); |
| 61 | 32 |
| 62 // Material Design |Mode| for Chrome OS system UI. Used only by tests. | |
| 63 static Mode mode(); | |
| 64 | |
| 65 // Returns true if Material Design is enabled in Chrome OS system UI. | |
| 66 // Maps to "ash-md" flag "enabled" or "experimental" values. | |
| 67 static bool IsMaterial(); | |
| 68 | |
| 69 // Returns true if Material Design normal features are enabled in Chrome OS | |
| 70 // system UI. Maps to "--ash-md=enabled" command line switch value. | |
| 71 static bool IsMaterialNormal(); | |
| 72 | |
| 73 // Returns true if Material Design experimental features are enabled in | |
| 74 // Chrome OS system UI. Maps to "--ash-md=experimental" command line switch | |
| 75 // value. | |
| 76 static bool IsMaterialExperimental(); | |
| 77 | |
| 78 // Returns the per-platform default material design variant. | |
| 79 static Mode DefaultMode(); | |
| 80 | |
| 81 // Sets |mode_| to |mode|. Can be used by tests to directly set the mode. | |
| 82 static void SetMode(Mode mode); | |
| 83 | |
| 84 // Resets the initialization state to uninitialized. To be used by tests to | |
| 85 // allow calling Initialize() more than once. | |
| 86 static void Uninitialize(); | |
| 87 | |
| 88 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController); | 33 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController); |
| 89 }; | 34 }; |
| 90 | 35 |
| 91 } // namespace ash | 36 } // namespace ash |
| 92 | 37 |
| 93 #endif // ASH_COMMON_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ | 38 #endif // ASH_COMMON_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ |
| OLD | NEW |