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-md" flag "enabled" or "experimental" values. |
| 37 static bool IsMaterial(); |
| 38 |
| 39 // Returns true if Material Design experimental features are enabled in |
| 40 // Chrome OS system UI. |
| 41 // Maps to "--ash-md=experimental" command line switch value. |
| 42 static bool IsMaterialExperimental(); |
| 43 |
| 44 private: |
| 45 friend class test::MaterialDesignControllerTestAPI; |
| 46 |
| 47 // Declarations only. Do not allow construction of an object. |
| 48 MaterialDesignController(); |
| 49 ~MaterialDesignController(); |
| 50 |
| 51 // Material Design |Mode| for Chrome OS system UI. Used by tests. |
| 52 static Mode mode(); |
| 53 |
| 54 // Returns the per-platform default material design variant. |
| 55 static Mode DefaultMode(); |
| 56 |
| 57 // Sets |mode_| to |mode|. Can be used by tests to directly set the mode. |
| 58 static void SetMode(Mode mode); |
| 59 |
| 60 // Resets the initialization state to uninitialized. To be used by tests to |
| 61 // allow calling Initialize() more than once. |
| 62 static void Uninitialize(); |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController); |
| 65 }; |
| 66 |
| 67 } // namespace ash |
| 68 |
| 69 #endif // ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ |
OLD | NEW |