OLD | NEW |
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 COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ | 5 #ifndef COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
6 #define COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ | 6 #define COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // Reads the state from |flags_storage| and adds the command line flags | 68 // Reads the state from |flags_storage| and adds the command line flags |
69 // belonging to the active feature entries to |command_line|. Features are | 69 // belonging to the active feature entries to |command_line|. Features are |
70 // appended via |enable_features_flag_name| and |disable_features_flag_name|. | 70 // appended via |enable_features_flag_name| and |disable_features_flag_name|. |
71 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, | 71 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
72 base::CommandLine* command_line, | 72 base::CommandLine* command_line, |
73 SentinelsMode sentinels, | 73 SentinelsMode sentinels, |
74 const char* enable_features_flag_name, | 74 const char* enable_features_flag_name, |
75 const char* disable_features_flag_name); | 75 const char* disable_features_flag_name); |
76 | 76 |
77 // Reads the state from |flags_storage| and returns the set of command line | 77 // Reads the state from |flags_storage| and returns a set of strings |
78 // flags that correspond to enabled entries. Does not populate any information | 78 // corresponding to enabled entries. Does not populate any information about |
79 // about entries that enable/disable base::Feature states. | 79 // entries that enable/disable base::Feature states. |
80 std::set<std::string> GetSwitchesFromFlags(FlagsStorage* flags_storage); | 80 std::set<std::string> GetSwitchesFromFlags(FlagsStorage* flags_storage); |
81 | 81 |
| 82 // Reads the state from |flags_storage| and returns a set of strings |
| 83 // corresponding to enabled/disabled base::Feature states. Feature names are |
| 84 // suffixed with ":enabled" or ":disabled" depending on their state. |
| 85 std::set<std::string> GetFeaturesFromFlags(FlagsStorage* flags_storage); |
| 86 |
82 bool IsRestartNeededToCommitChanges(); | 87 bool IsRestartNeededToCommitChanges(); |
83 void SetFeatureEntryEnabled(FlagsStorage* flags_storage, | 88 void SetFeatureEntryEnabled(FlagsStorage* flags_storage, |
84 const std::string& internal_name, | 89 const std::string& internal_name, |
85 bool enable); | 90 bool enable); |
86 void RemoveFlagsSwitches( | 91 void RemoveFlagsSwitches( |
87 std::map<std::string, base::CommandLine::StringType>* switch_list); | 92 std::map<std::string, base::CommandLine::StringType>* switch_list); |
88 void ResetAllFlags(FlagsStorage* flags_storage); | 93 void ResetAllFlags(FlagsStorage* flags_storage); |
89 void Reset(); | 94 void Reset(); |
90 | 95 |
91 // Registers variations parameter values selected for features in about:flags. | 96 // Registers variations parameter values selected for features in about:flags. |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Map from switch name to a set of string, that keeps track which strings | 204 // Map from switch name to a set of string, that keeps track which strings |
200 // were appended to existing (list value) switches. | 205 // were appended to existing (list value) switches. |
201 std::map<std::string, std::set<std::string>> appended_switches_; | 206 std::map<std::string, std::set<std::string>> appended_switches_; |
202 | 207 |
203 DISALLOW_COPY_AND_ASSIGN(FlagsState); | 208 DISALLOW_COPY_AND_ASSIGN(FlagsState); |
204 }; | 209 }; |
205 | 210 |
206 } // namespace flags_ui | 211 } // namespace flags_ui |
207 | 212 |
208 #endif // COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ | 213 #endif // COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
OLD | NEW |