Create separate sections for available/unavailable flags.
On Linux, searching for "this experiment is not supported" returns 23
results. To make it a little easier to navigate, create a separate
section to list all the unsupported experiments.
BUG=179649
Review URL: https://chromiumcodereview.appspot.com/12748002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201015 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index b092fee..32e3c12 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1658,13 +1658,15 @@
FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
}
-ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access) {
+void GetFlagsExperimentsData(PrefService* prefs,
+ FlagAccess access,
+ base::ListValue* supported_experiments,
+ base::ListValue* unsupported_experiments) {
std::set<std::string> enabled_experiments;
GetSanitizedEnabledFlags(prefs, &enabled_experiments);
int current_platform = GetCurrentPlatform();
- ListValue* experiments_data = new ListValue();
for (size_t i = 0; i < num_experiments; ++i) {
const Experiment& experiment = experiments[i];
@@ -1675,13 +1677,6 @@
data->SetString("description",
l10n_util::GetStringUTF16(
experiment.visible_description_id));
- bool supported = (experiment.supported_platforms & current_platform) != 0;
-#if defined(OS_CHROMEOS)
- if (access == kOwnerAccessToFlags &&
- (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0)
- supported = true;
-#endif
- data->SetBoolean("supported", supported);
ListValue* supported_platforms = new ListValue();
AddOsStrings(experiment.supported_platforms, supported_platforms);
@@ -1701,9 +1696,18 @@
NOTREACHED();
}
- experiments_data->Append(data);
+ bool supported = (experiment.supported_platforms & current_platform) != 0;
+#if defined(OS_CHROMEOS)
+ if (access == kOwnerAccessToFlags &&
+ (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
+ supported = true;
+ }
+#endif
+ if (supported)
+ supported_experiments->Append(data);
+ else
+ unsupported_experiments->Append(data);
}
- return experiments_data;
}
bool IsRestartNeededToCommitChanges() {