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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
oshima 2016/04/25 23:01:43 2016 same for other files.
varkha 2016/04/25 23:16:05 Done.
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 // Initializes |mode_|. Must be called before calling IsModeMaterial().
21 static void Initialize();
22
23 // Returns true if Material Design is enabled in Chrome OS system UI.
24 static bool IsMaterial();
25
26 private:
27 friend class test::MaterialDesignControllerTestAPI;
28
29 // Tracks whether |mode_| has been initialized. This is necessary so tests can
30 // reset the state back to a clean state during tear down.
31 static bool is_mode_initialized_;
32
33 // True if Material Design is enabled in Chrome OS system UI.
34 static bool mode_;
oshima 2016/04/25 23:01:43 move private static to anonymous namespace in .cc
varkha 2016/04/25 23:16:05 It is used by a friend MaterialDesignControllerTes
oshima 2016/04/26 05:56:37 In that case, how about defiing enum enum class M
varkha 2016/04/26 15:06:02 I think this doesn't do what I want to accomplish:
oshima 2016/04/26 16:06:57 mode_(NONE) will do it.
35
36 // Declarations only. Do not allow construction of an object.
37 MaterialDesignController();
38 ~MaterialDesignController();
39
40 // Returns the per-platform default material design variant.
41 static bool DefaultMode();
42
43 // Sets |mode_| to |mode| and updates |is_mode_initialized_| to true. Can be
44 // used by tests to directly set the mode.
45 static void SetMode(bool mode);
46
47 // Resets the initialization state to uninitialized. To be used by tests to
48 // allow calling Initialize() more than once.
49 static void Uninitialize();
50
51 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController);
52 };
53
54 } // namespace ash
55
56 #endif // ASH_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698