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

Unified Diff: chrome/browser/about_flags.h

Issue 12326019: Refactor about_flags.cc to make defining enabled/disabled/default flags easier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/about_flags.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.h
===================================================================
--- chrome/browser/about_flags.h (revision 183834)
+++ chrome/browser/about_flags.h (working copy)
@@ -9,6 +9,7 @@
#include <string>
#include "base/command_line.h"
+#include "base/string16.h"
class PrefService;
@@ -37,6 +38,12 @@
// command_line of the Experiment is not used. If the experiment is enabled
// the command line of the selected Choice is enabled.
MULTI_VALUE,
+
+ // The experiment has three possible values: Default, Enabled and Disabled.
+ // This should be used for experiments that may have their own logic to
+ // decide if the feature should be on when not explicitly specified via
+ // about flags - for example via FieldTrials.
+ ENABLE_DISABLE_VALUE,
};
// Used for MULTI_VALUE types to describe one of the possible values the user
@@ -69,20 +76,31 @@
// Type of experiment.
Type type;
- // The commandline switch and value that are added when this lab is active.
+ // The commandline switch and value that are added when this flag is active.
// This is different from |internal_name| so that the commandline flag can be
// renamed without breaking the prefs file.
- // This is used if type is SINGLE_VALUE.
+ // This is used if type is SINGLE_VALUE or ENABLE_DISABLE_VALUE.
const char* command_line_switch;
// Simple switches that have no value should use "" for command_line_value.
const char* command_line_value;
+ // For ENABLE_DISABLE_VALUE, the command line switch and value to explictly
+ // disable the feature.
+ const char* disable_command_line_switch;
+ const char* disable_command_line_value;
+
// This is used if type is MULTI_VALUE.
const Choice* choices;
// Number of |choices|.
// This is used if type is MULTI_VALUE.
int num_choices;
+
+ // Returns the name used in prefs for the choice at the specified |index|.
+ std::string NameForChoice(int index) const;
+
+ // Returns the human readable description for the choice at |index|.
+ string16 DescriptionForChoice(int index) const;
};
// Reads the Labs |prefs| (called "Labs" for historical reasons) and adds the
@@ -117,6 +135,7 @@
void RecordUMAStatistics(const PrefService* prefs);
namespace testing {
+
// Clears internal global state, for unit tests.
void ClearState();
« no previous file with comments | « no previous file | chrome/browser/about_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698