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 BASE_FEATURE_LIST_H_ | 5 #ifndef BASE_FEATURE_LIST_H_ |
6 #define BASE_FEATURE_LIST_H_ | 6 #define BASE_FEATURE_LIST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // enable or disable, respectively. If a feature appears on both lists, then | 84 // enable or disable, respectively. If a feature appears on both lists, then |
85 // it will be disabled. If a list entry has the format "FeatureName<TrialName" | 85 // it will be disabled. If a list entry has the format "FeatureName<TrialName" |
86 // then this initialization will also associate the feature state override | 86 // then this initialization will also associate the feature state override |
87 // with the named field trial, if it exists. Must only be invoked during the | 87 // with the named field trial, if it exists. Must only be invoked during the |
88 // initialization phase (before FinalizeInitialization() has been called). | 88 // initialization phase (before FinalizeInitialization() has been called). |
89 void InitializeFromCommandLine(const std::string& enable_features, | 89 void InitializeFromCommandLine(const std::string& enable_features, |
90 const std::string& disable_features); | 90 const std::string& disable_features); |
91 | 91 |
92 // Specifies whether a feature override enables or disables the feature. | 92 // Specifies whether a feature override enables or disables the feature. |
93 enum OverrideState { | 93 enum OverrideState { |
| 94 OVERRIDE_USE_DEFAULT, |
94 OVERRIDE_DISABLE_FEATURE, | 95 OVERRIDE_DISABLE_FEATURE, |
95 OVERRIDE_ENABLE_FEATURE, | 96 OVERRIDE_ENABLE_FEATURE, |
96 }; | 97 }; |
97 | 98 |
98 // Returns true if the state of |feature_name| has been overridden via | 99 // Returns true if the state of |feature_name| has been overridden via |
99 // |InitializeFromCommandLine()|. | 100 // |InitializeFromCommandLine()|. |
100 bool IsFeatureOverriddenFromCommandLine(const std::string& feature_name, | 101 bool IsFeatureOverriddenFromCommandLine(const std::string& feature_name, |
101 OverrideState state) const; | 102 OverrideState state) const; |
102 | 103 |
103 // Associates a field trial for reporting purposes corresponding to the | 104 // Associates a field trial for reporting purposes corresponding to the |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // Whether this object has been fully initialized. This gets set to true as a | 230 // Whether this object has been fully initialized. This gets set to true as a |
230 // result of FinalizeInitialization(). | 231 // result of FinalizeInitialization(). |
231 bool initialized_; | 232 bool initialized_; |
232 | 233 |
233 DISALLOW_COPY_AND_ASSIGN(FeatureList); | 234 DISALLOW_COPY_AND_ASSIGN(FeatureList); |
234 }; | 235 }; |
235 | 236 |
236 } // namespace base | 237 } // namespace base |
237 | 238 |
238 #endif // BASE_FEATURE_LIST_H_ | 239 #endif // BASE_FEATURE_LIST_H_ |
OLD | NEW |