Chromium Code Reviews| Index: ui/base/material_design/material_design_controller.h |
| diff --git a/ui/base/material_design/material_design_controller.h b/ui/base/material_design/material_design_controller.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c2e49d79b6f815e16072de14886eafa8882ffe00 |
| --- /dev/null |
| +++ b/ui/base/material_design/material_design_controller.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ |
| +#define UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ |
| + |
| +#include "base/macros.h" |
| +#include "ui/base/ui_base_export.h" |
| + |
| +namespace ui { |
| + |
| +namespace test { |
| +class MaterialDesignControllerTestAPI; |
| +} // namespace test |
| + |
| +// Central controller to handle material design look and feel. |
| +class UI_BASE_EXPORT MaterialDesignController { |
| + public: |
| + // The different look and feel options. |
| + enum class LookAndFeel { |
|
tdanderson
2015/06/18 20:54:23
+1 to Gene's suggestion of using "mode" instead of
bruthig
2015/06/22 18:51:11
Done.
|
| + // Basic material design look and feel. |
| + MATERIAL, |
| + // Material design look and feel targeted for convertible devices. |
|
tdanderson
2015/06/18 20:54:23
I'd re-phrase the comment here (and in ui_base_swi
bruthig
2015/06/22 18:51:11
Done.
|
| + HYBRID, |
| + // Classic, non-material, look and feel. |
| + CLASSIC |
|
tdanderson
2015/06/18 20:54:24
Naming these MATERIAL, MATERIAL_HYBRID, and NON_MA
bruthig
2015/06/22 18:51:11
Done.
|
| + }; |
| + |
| + // Get the current LookAndFeel that should be used by the system. |
| + static LookAndFeel GetLookAndFeel(); |
| + |
| + private: |
| + friend class test::MaterialDesignControllerTestAPI; |
| + |
| + // Tracks whether |look_and_feel_| has been initialized. |
| + static bool is_look_and_feel_initialized_; |
|
tdanderson
2015/06/18 20:54:23
Perhaps include a comment about why this is needed
bruthig
2015/06/22 18:51:11
Done.
|
| + |
| + // The current look and feel to be used by the system. |
| + static LookAndFeel look_and_feel_; |
| + |
| + // Declarations only. Do not allow construction of an object. |
| + MaterialDesignController(); |
| + ~MaterialDesignController(); |
| + |
| + // Initializes |look_and_feel_|. |
| + static void InitializeLookAndFeel(); |
| + |
| + // Resets the look and feel state to uninitialized. To be used by tests to |
| + // cleanup global state. |
| + static void UninitializeLookAndFeel(); |
| + |
| + // Set |look_and_feel_| to |look_and_feel| and updates |
| + // |is_look_and_feel_initialized_| to true. Can be used by tests to directly |
| + // set the look and feel. |
| + static void SetLookAndFeel(LookAndFeel look_and_feel); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MaterialDesignController); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ |