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

Side by Side Diff: ui/base/material_design/material_design_controller.h

Issue 2089263002: [top-chrome-md] Allows UpdateMaterialDesignColors to be called before MDC::Initialize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [top-chrome-md] Allows UpdateMaterialDesignColors to be called before MDC::Initialize() (back to Pa… Created 4 years, 5 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
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ 5 #ifndef UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
6 #define UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ 6 #define UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/base/ui_base_export.h" 9 #include "ui/base/ui_base_export.h"
10 10
(...skipping 26 matching lines...) Expand all
37 // Returns true if the current mode is a material design variant. 37 // Returns true if the current mode is a material design variant.
38 static bool IsModeMaterial(); 38 static bool IsModeMaterial();
39 39
40 // Returns true if the current mode is a material design variant and this mode 40 // Returns true if the current mode is a material design variant and this mode
41 // should be extended to cover secondary UI. 41 // should be extended to cover secondary UI.
42 static bool IsSecondaryUiMaterial(); 42 static bool IsSecondaryUiMaterial();
43 43
44 // Returns the per-platform default material design variant. 44 // Returns the per-platform default material design variant.
45 static Mode DefaultMode(); 45 static Mode DefaultMode();
46 46
47 static bool is_mode_initialized() { return is_mode_initialized_; }
48
47 private: 49 private:
48 friend class test::MaterialDesignControllerTestAPI; 50 friend class test::MaterialDesignControllerTestAPI;
49 51
50 // Tracks whether |mode_| has been initialized. This is necessary so tests can 52 // Tracks whether |mode_| has been initialized. This is necessary so tests can
51 // reset the state back to a clean state during tear down. 53 // reset the state back to a clean state during tear down.
52 static bool is_mode_initialized_; 54 static bool is_mode_initialized_;
sadrul 2016/06/23 19:30:29 This is now being used in non-test case. Please up
varkha 2016/06/23 19:40:02 Done.
53 55
54 // The current Mode to be used by the system. 56 // The current Mode to be used by the system.
55 static Mode mode_; 57 static Mode mode_;
56 58
57 // True when |mode_| applies beyond the primary UI (toolbar, tabstrip, 59 // True when |mode_| applies beyond the primary UI (toolbar, tabstrip,
58 // etc.). For example, this controls use of MD inside bubbles and dialogs. 60 // etc.). For example, this controls use of MD inside bubbles and dialogs.
59 static bool include_secondary_ui_; 61 static bool include_secondary_ui_;
60 62
61 // Declarations only. Do not allow construction of an object. 63 // Declarations only. Do not allow construction of an object.
62 MaterialDesignController(); 64 MaterialDesignController();
63 ~MaterialDesignController(); 65 ~MaterialDesignController();
64 66
65 // Resets the initialization state to uninitialized. To be used by tests to 67 // Resets the initialization state to uninitialized. To be used by tests to
66 // allow calling Initialize() more than once. 68 // allow calling Initialize() more than once.
67 static void Uninitialize(); 69 static void Uninitialize();
68 70
69 // Set |mode_| to |mode| and updates |is_mode_initialized_| to true. Can be 71 // Set |mode_| to |mode| and updates |is_mode_initialized_| to true. Can be
70 // used by tests to directly set the mode. 72 // used by tests to directly set the mode.
71 static void SetMode(Mode mode); 73 static void SetMode(Mode mode);
72 74
73 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController); 75 DISALLOW_COPY_AND_ASSIGN(MaterialDesignController);
74 }; 76 };
75 77
76 } // namespace ui 78 } // namespace ui
77 79
78 #endif // UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_ 80 #endif // UI_BASE_MATERIAL_DESIGN_MATERIAL_DESIGN_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698