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

Unified Diff: ui/base/resource/material_design/material_design_controller.h

Issue 1188713007: Moved --top-chrome-md command line switch from chrome_switches to ui_base_switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed typedef in unittest. Created 5 years, 6 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
Index: ui/base/resource/material_design/material_design_controller.h
diff --git a/ui/base/resource/material_design/material_design_controller.h b/ui/base/resource/material_design/material_design_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..a12ae53e4666bea47417ab55b784d2d386e8f1db
--- /dev/null
+++ b/ui/base/resource/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_RESOURCE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
+#define UI_BASE_RESOURCE_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 modes.
+class UI_BASE_EXPORT MaterialDesignController {
+ public:
+ // The different material design modes.
+ enum class Mode {
+ // Basic material design.
+ MATERIAL,
+ // Material design targeted at mouse/touch hybrid devices.
+ MATERIAL_HYBRID,
+ // Classic, non-material design.
+ NON_MATERIAL
+ };
+
+ // Get the current Mode that should be used by the system.
+ static Mode GetMode();
+
+ private:
+ friend class test::MaterialDesignControllerTestAPI;
+
+ // Tracks whether |mode_| has been initialized. This is necessary so tests can
+ // reset the state back to a clean state during tear down.
+ static bool is_mode_initialized_;
+
+ // The current Mode to be used by the system.
+ static Mode mode_;
+
+ // Declarations only. Do not allow construction of an object.
+ MaterialDesignController();
+ ~MaterialDesignController();
+
+ // Initializes |mode_|.
+ static void InitializeMode();
+
+ // Resets the Mode state to uninitialized. To be used by tests to cleanup
+ // global state.
+ static void UninitializeMode();
+
+ // Set |mode_| to |mode| and updates |is_mode_initialized_| to true. Can be
+ // used by tests to directly set the mode.
+ static void SetMode(Mode mode);
+
+ DISALLOW_COPY_AND_ASSIGN(MaterialDesignController);
+};
+
+} // namespace ui
+
+#endif // UI_BASE_RESOURCE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698