Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ | |
| 6 #define ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "base/macros.h" | |
| 10 | |
| 11 namespace ash { | |
| 12 | |
| 13 namespace test { | |
| 14 class MaterialDesignControllerTestAPI; | |
| 15 } // namespace test | |
| 16 | |
| 17 // Central controller to handle material design modes. | |
| 18 class ASH_EXPORT MaterialDesignController { | |
| 19 public: | |
| 20 // The different material design modes for Chrome OS system UI. | |
| 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 static void Initialize(); | |
| 34 | |
| 35 // Returns true if Material Design is enabled in Chrome OS system UI. | |
| 36 // Maps to "ash-enable-md" and "ash-diable-md flags" pair of flags. | |
|
bruthig
2016/04/27 19:57:36
Is this doc up to date?
sp/ash-diable-md->ash-dis
varkha
2016/04/27 21:00:09
Done.
| |
| 37 // Returns false if both flags are specified in command line. | |
| 38 static bool IsMaterial(); | |
| 39 | |
| 40 // | |
|
bruthig
2016/04/27 19:57:36
nit: empty doc?
varkha
2016/04/27 21:00:09
Done.
| |
| 41 static bool IsMaterialExperimental(); | |
| 42 | |
| 43 private: | |
| 44 friend class test::MaterialDesignControllerTestAPI; | |
| 45 | |
| 46 // Declarations only. Do not allow construction of an object. | |
| 47 MaterialDesignController(); | |
| 48 ~MaterialDesignController(); | |
| 49 | |
| 50 // Material Design |Mode| for Chrome OS system UI. Used by tests. | |
| 51 static Mode mode(); | |
| 52 | |
| 53 // Returns the per-platform default material design variant. | |
| 54 static Mode DefaultMode(); | |
| 55 | |
| 56 // Sets |mode_| to |mode|. Can be used by tests to directly set the mode. | |
| 57 static void SetMode(Mode mode); | |
| 58 | |
| 59 // Resets the initialization state to uninitialized. To be used by tests to | |
| 60 // allow calling Initialize() more than once. | |
| 61 static void Uninitialize(); | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController); | |
| 64 }; | |
| 65 | |
| 66 } // namespace ash | |
| 67 | |
| 68 #endif // ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ | |
| OLD | NEW |