Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3453)

Unified Diff: ash/material_design/material_design_controller.h

Issue 1921133002: Adds ash::MaterialDesignController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds ash::MaterialDesignController (multi-value) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/material_design/material_design_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/material_design/material_design_controller.h
diff --git a/ash/material_design/material_design_controller.h b/ash/material_design/material_design_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae0c15928d090ea211dc9d001ad2e076b0bfbb00
--- /dev/null
+++ b/ash/material_design/material_design_controller.h
@@ -0,0 +1,68 @@
+// Copyright 2016 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 ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
+#define ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
+
+#include "ash/ash_export.h"
+#include "base/macros.h"
+
+namespace ash {
+
+namespace test {
+class MaterialDesignControllerTestAPI;
+} // namespace test
+
+// Central controller to handle material design modes.
+class ASH_EXPORT MaterialDesignController {
+ public:
+ // The different material design modes for Chrome OS system UI.
+ enum Mode {
+ // Not initialized.
+ UNINITIALIZED = -1,
+ // Classic, non-material design.
+ NON_MATERIAL = 0,
+ // Basic material design.
+ MATERIAL_NORMAL = 1,
+ // Material design with experimental features.
+ MATERIAL_EXPERIMENTAL = 2
+ };
+
+ // Initializes |mode_|. Must be called before calling IsMaterial().
+ static void Initialize();
+
+ // Returns true if Material Design is enabled in Chrome OS system UI.
+ // 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.
+ // Returns false if both flags are specified in command line.
+ static bool IsMaterial();
+
+ //
bruthig 2016/04/27 19:57:36 nit: empty doc?
varkha 2016/04/27 21:00:09 Done.
+ static bool IsMaterialExperimental();
+
+ private:
+ friend class test::MaterialDesignControllerTestAPI;
+
+ // Declarations only. Do not allow construction of an object.
+ MaterialDesignController();
+ ~MaterialDesignController();
+
+ // Material Design |Mode| for Chrome OS system UI. Used by tests.
+ static Mode mode();
+
+ // Returns the per-platform default material design variant.
+ static Mode DefaultMode();
+
+ // Sets |mode_| to |mode|. Can be used by tests to directly set the mode.
+ static void SetMode(Mode mode);
+
+ // Resets the initialization state to uninitialized. To be used by tests to
+ // allow calling Initialize() more than once.
+ static void Uninitialize();
+
+ DISALLOW_COPY_AND_ASSIGN(MaterialDesignController);
+};
+
+} // namespace ash
+
+#endif // ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
« no previous file with comments | « ash/ash_switches.cc ('k') | ash/material_design/material_design_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698