| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_ABOUT_FLAGS_H_ | 5 #ifndef CHROME_BROWSER_ABOUT_FLAGS_H_ |
| 6 #define CHROME_BROWSER_ABOUT_FLAGS_H_ | 6 #define CHROME_BROWSER_ABOUT_FLAGS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // feature (i.e. no command line option). For MULTI_VALUE entries, the | 49 // feature (i.e. no command line option). For MULTI_VALUE entries, the |
| 50 // command_line of the FeatureEntry is not used. If the experiment is | 50 // command_line of the FeatureEntry is not used. If the experiment is |
| 51 // enabled the command line of the selected Choice is enabled. | 51 // enabled the command line of the selected Choice is enabled. |
| 52 MULTI_VALUE, | 52 MULTI_VALUE, |
| 53 | 53 |
| 54 // The feature has three possible values: Default, Enabled and Disabled. | 54 // The feature has three possible values: Default, Enabled and Disabled. |
| 55 // This should be used for features that may have their own logic to decide | 55 // This should be used for features that may have their own logic to decide |
| 56 // if the feature should be on when not explicitly specified via about | 56 // if the feature should be on when not explicitly specified via about |
| 57 // flags - for example via FieldTrials. | 57 // flags - for example via FieldTrials. |
| 58 ENABLE_DISABLE_VALUE, | 58 ENABLE_DISABLE_VALUE, |
| 59 |
| 60 // Corresponds to a base::Feature, per base/feature_list.h. The entry will |
| 61 // have three states: Default, Enabled, Disabled. When not specified or set |
| 62 // to Default, the normal default value of the feature is used. |
| 63 FEATURE_VALUE, |
| 59 }; | 64 }; |
| 60 | 65 |
| 61 // Used for MULTI_VALUE types to describe one of the possible values the user | 66 // Used for MULTI_VALUE types to describe one of the possible values the user |
| 62 // can select. | 67 // can select. |
| 63 struct Choice { | 68 struct Choice { |
| 64 // ID of the message containing the choice name. | 69 // ID of the message containing the choice name. |
| 65 int description_id; | 70 int description_id; |
| 66 | 71 |
| 67 // Command line switch and value to enabled for this choice. | 72 // Command line switch and value to enabled for this choice. |
| 68 const char* command_line_switch; | 73 const char* command_line_switch; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 94 // This is used if type is SINGLE_VALUE or ENABLE_DISABLE_VALUE. | 99 // This is used if type is SINGLE_VALUE or ENABLE_DISABLE_VALUE. |
| 95 const char* command_line_switch; | 100 const char* command_line_switch; |
| 96 // Simple switches that have no value should use "" for command_line_value. | 101 // Simple switches that have no value should use "" for command_line_value. |
| 97 const char* command_line_value; | 102 const char* command_line_value; |
| 98 | 103 |
| 99 // For ENABLE_DISABLE_VALUE, the command line switch and value to explicitly | 104 // For ENABLE_DISABLE_VALUE, the command line switch and value to explicitly |
| 100 // disable the feature. | 105 // disable the feature. |
| 101 const char* disable_command_line_switch; | 106 const char* disable_command_line_switch; |
| 102 const char* disable_command_line_value; | 107 const char* disable_command_line_value; |
| 103 | 108 |
| 109 // For FEATURE_VALUE, the name of the base::Feature this entry corresponds to. |
| 110 const char* feature_name; |
| 111 |
| 104 // This is used if type is MULTI_VALUE. | 112 // This is used if type is MULTI_VALUE. |
| 105 const Choice* choices; | 113 const Choice* choices; |
| 106 | 114 |
| 107 // Number of |choices|. | 115 // Number of |choices|. |
| 108 // This is used if type is MULTI_VALUE. | 116 // This is used if type is MULTI_VALUE. |
| 109 int num_choices; | 117 int num_choices; |
| 110 | 118 |
| 111 // Returns the name used in prefs for the choice at the specified |index|. | 119 // Returns the name used in prefs for the choice at the specified |index|. |
| 112 std::string NameForChoice(int index) const; | 120 std::string NameForChoice(int index) const; |
| 113 | 121 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 210 |
| 203 // This value is reported as switch histogram ID if switch name has unknown | 211 // This value is reported as switch histogram ID if switch name has unknown |
| 204 // format. | 212 // format. |
| 205 extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId; | 213 extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId; |
| 206 | 214 |
| 207 } // namespace testing | 215 } // namespace testing |
| 208 | 216 |
| 209 } // namespace about_flags | 217 } // namespace about_flags |
| 210 | 218 |
| 211 #endif // CHROME_BROWSER_ABOUT_FLAGS_H_ | 219 #endif // CHROME_BROWSER_ABOUT_FLAGS_H_ |
| OLD | NEW |