Durable Storage: Refactor browser test and test the basic "deny" flow.
[chromium-blink-merge.git] / ui / base / resource / material_design / material_design_controller.h
blobaf92f4d62bcd40067d0fc66f188a8d6cc14d19ab
1 // Copyright 2015 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.
5 #ifndef UI_BASE_RESOURCE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
6 #define UI_BASE_RESOURCE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
8 #include "base/macros.h"
9 #include "ui/base/ui_base_export.h"
11 namespace ui {
13 namespace test {
14 class MaterialDesignControllerTestAPI;
15 } // namespace test
17 // Central controller to handle material design modes.
18 class UI_BASE_EXPORT MaterialDesignController {
19 public:
20 // The different material design modes. The order cannot be changed without
21 // updating references as these are used as array indices.
22 enum Mode {
23 // Classic, non-material design.
24 NON_MATERIAL = 0,
25 // Basic material design.
26 MATERIAL_NORMAL = 1,
27 // Material design targeted at mouse/touch hybrid devices.
28 MATERIAL_HYBRID = 2
31 // Get the current Mode that should be used by the system.
32 static Mode GetMode();
34 // Returns true if the current mode is a material design variant.
35 static bool IsModeMaterial();
37 private:
38 friend class test::MaterialDesignControllerTestAPI;
40 // Tracks whether |mode_| has been initialized. This is necessary so tests can
41 // reset the state back to a clean state during tear down.
42 static bool is_mode_initialized_;
44 // The current Mode to be used by the system.
45 static Mode mode_;
47 // Declarations only. Do not allow construction of an object.
48 MaterialDesignController();
49 ~MaterialDesignController();
51 // Initializes |mode_|.
52 static void InitializeMode();
54 // Resets the Mode state to uninitialized. To be used by tests to cleanup
55 // global state.
56 static void UninitializeMode();
58 // Set |mode_| to |mode| and updates |is_mode_initialized_| to true. Can be
59 // used by tests to directly set the mode.
60 static void SetMode(Mode mode);
62 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController);
65 } // namespace ui
67 #endif // UI_BASE_RESOURCE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_