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

Side by Side Diff: chrome/browser/about_flags.h

Issue 1408783002: Support base::Feature entries in chrome://flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 2 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 | « base/feature_list.cc ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « base/feature_list.cc ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698