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

Side by Side Diff: components/flags_ui/feature_entry.h

Issue 2774203002: Migrate about:flags messages to const char* (Closed)
Patch Set: fix iOS compilation Created 3 years, 8 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/flag_descriptions.cc ('k') | components/flags_ui/feature_entry.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 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_FEATURE_ENTRY_H_ 5 #ifndef COMPONENTS_FLAGS_UI_FEATURE_ENTRY_H_
6 #define COMPONENTS_FLAGS_UI_FEATURE_ENTRY_H_ 6 #define COMPONENTS_FLAGS_UI_FEATURE_ENTRY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 11
12 namespace base { 12 namespace base {
13 struct Feature; 13 struct Feature;
14 } 14 }
15 15
16 namespace flags_ui { 16 namespace flags_ui {
17 17
18 // Generic experiment choice option names.
19 extern const char kGenericExperimentChoiceDefault[];
20 extern const char kGenericExperimentChoiceEnabled[];
21 extern const char kGenericExperimentChoiceDisabled[];
22 extern const char kGenericExperimentChoiceAutomatic[];
23
18 // FeatureEntry is used to describe an experimental feature. 24 // FeatureEntry is used to describe an experimental feature.
19 // 25 //
20 // Note that features should eventually be either turned on by default with no 26 // Note that features should eventually be either turned on by default with no
21 // about_flags entries or deleted. Most feature entries should only be around 27 // about_flags entries or deleted. Most feature entries should only be around
22 // for a few milestones, until their full launch. 28 // for a few milestones, until their full launch.
23 struct FeatureEntry { 29 struct FeatureEntry {
24 enum Type { 30 enum Type {
25 // A feature with a single flag value. 31 // A feature with a single flag value.
26 // 32 //
27 // For new entries, it is recommended to instead use FEATURE_VALUE macro 33 // For new entries, it is recommended to instead use FEATURE_VALUE macro
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 DEFAULT, 81 DEFAULT,
76 // The feature is enabled by the user. 82 // The feature is enabled by the user.
77 ENABLED, 83 ENABLED,
78 // The feature is disabled by the user. 84 // The feature is disabled by the user.
79 DISABLED, 85 DISABLED,
80 }; 86 };
81 87
82 // Used for MULTI_VALUE types to describe one of the possible values the user 88 // Used for MULTI_VALUE types to describe one of the possible values the user
83 // can select. 89 // can select.
84 struct Choice { 90 struct Choice {
85 // ID of the message containing the choice name. 91 // The message containing the choice name.
86 int description_id; 92 const char* description;
87 93
88 // Command line switch and value to enabled for this choice. 94 // Command line switch and value to enabled for this choice.
89 const char* command_line_switch; 95 const char* command_line_switch;
90 // Simple switches that have no value should use "" for command_line_value. 96 // Simple switches that have no value should use "" for command_line_value.
91 const char* command_line_value; 97 const char* command_line_value;
92 }; 98 };
93 99
94 // Configures one parameter for FEATURE_WITH_VARIATIONS_VALUE. 100 // Configures one parameter for FEATURE_WITH_VARIATIONS_VALUE.
95 struct FeatureParam { 101 struct FeatureParam {
96 const char* param_name; 102 const char* param_name;
(...skipping 16 matching lines...) Expand all
113 // VariationsHttpHeaderProvider::SetDefaultVariationIds or nullptr 119 // VariationsHttpHeaderProvider::SetDefaultVariationIds or nullptr
114 // if you do not need to set any variation_id for this feature variation. 120 // if you do not need to set any variation_id for this feature variation.
115 const char* variation_id; 121 const char* variation_id;
116 }; 122 };
117 123
118 // The internal name of the feature entry. This is never shown to the user. 124 // The internal name of the feature entry. This is never shown to the user.
119 // It _is_ however stored in the prefs file, so you shouldn't change the 125 // It _is_ however stored in the prefs file, so you shouldn't change the
120 // name of existing flags. 126 // name of existing flags.
121 const char* internal_name; 127 const char* internal_name;
122 128
123 // String id of the message containing the feature's name. 129 // The feature's name.
124 int visible_name_id; 130 const char* visible_name;
125 131
126 // String id of the message containing the feature's description. 132 // The feature's description.
127 int visible_description_id; 133 const char* visible_description;
128 134
129 // The platforms the feature is available on. 135 // The platforms the feature is available on.
130 // Needs to be more than a compile-time #ifdef because of profile sync. 136 // Needs to be more than a compile-time #ifdef because of profile sync.
131 unsigned supported_platforms; // bitmask 137 unsigned supported_platforms; // bitmask
132 138
133 // Type of entry. 139 // Type of entry.
134 Type type; 140 Type type;
135 141
136 // The commandline switch and value that are added when this flag is active. 142 // The commandline switch and value that are added when this flag is active.
137 // This is different from |internal_name| so that the commandline flag can be 143 // This is different from |internal_name| so that the commandline flag can be
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 201
196 // Separator used for multi values. Multi values are represented in prefs as 202 // Separator used for multi values. Multi values are represented in prefs as
197 // name-of-experiment + kMultiSeparator + selected_index. 203 // name-of-experiment + kMultiSeparator + selected_index.
198 extern const char kMultiSeparator[]; 204 extern const char kMultiSeparator[];
199 205
200 } // namespace 206 } // namespace
201 207
202 } // namespace flag_ui 208 } // namespace flag_ui
203 209
204 #endif // COMPONENTS_FLAGS_UI_FEATURE_ENTRY_H_ 210 #endif // COMPONENTS_FLAGS_UI_FEATURE_ENTRY_H_
OLDNEW
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | components/flags_ui/feature_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698