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

Unified Diff: chrome/browser/about_flags.cc

Issue 5025001: Removed Labs section from Chrome OS settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed RegisterPref call Created 10 years, 1 month 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 | « chrome/app/generated_resources.grd ('k') | chrome/browser/about_flags_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 366e173ce396597b250610bfe640e6b5d5799012..814ced82be70bbccb7f30fe455ff46bff2a551c6 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -24,6 +24,12 @@ namespace {
const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS;
+// Names for former Chrome OS Labs experiments, shared with prefs migration
+// code.
+const char kMediaPlayerExperimentName[] = "media-player";
+const char kAdvancedFileSystemExperimentName[] = "advanced-file-system";
+const char kVerticalTabsExperimentName[] = "vertical-tabs";
+
const Experiment kExperiments[] = {
{
"expose-for-tabs", // Do not change; see above.
@@ -38,12 +44,34 @@ const Experiment kExperiments[] = {
#endif
},
{
- "vertical-tabs", // Do not change; see above.
+ kMediaPlayerExperimentName,
+ IDS_FLAGS_MEDIA_PLAYER_NAME,
+ IDS_FLAGS_MEDIA_PLAYER_DESCRIPTION,
+ kOsCrOS,
+#if defined(OS_CHROMEOS)
+ // The switch exists only on Chrome OS.
+ switches::kEnableMediaPlayer
+#else
+ ""
+#endif
+ },
+ {
+ kAdvancedFileSystemExperimentName,
+ IDS_FLAGS_ADVANCED_FS_NAME,
+ IDS_FLAGS_ADVANCED_FS_DESCRIPTION,
+ kOsCrOS,
+#if defined(OS_CHROMEOS)
+ // The switch exists only on Chrome OS.
+ switches::kEnableAdvancedFileSystem
+#else
+ ""
+#endif
+ },
+ {
+ kVerticalTabsExperimentName,
IDS_FLAGS_SIDE_TABS_NAME,
IDS_FLAGS_SIDE_TABS_DESCRIPTION,
- // TODO(thakis): Move sidetabs to about:flags on ChromeOS
- // http://crbug.com/57634
- kOsWin,
+ kOsWin | kOsCrOS,
switches::kEnableVerticalTabs
},
{
@@ -228,6 +256,25 @@ class FlagsState {
DISALLOW_COPY_AND_ASSIGN(FlagsState);
};
+#if defined(OS_CHROMEOS)
+// Migrates Chrome OS Labs settings to experiments adding flags to enabled
+// experiment list if the corresponding pref is on.
+void MigrateChromeOSLabsPrefs(PrefService* prefs,
+ std::set<std::string>* result) {
+ DCHECK(prefs);
+ DCHECK(result);
+ if (prefs->GetBoolean(prefs::kLabsMediaplayerEnabled))
+ result->insert(kMediaPlayerExperimentName);
+ if (prefs->GetBoolean(prefs::kLabsAdvancedFilesystemEnabled))
+ result->insert(kAdvancedFileSystemExperimentName);
+ if (prefs->GetBoolean(prefs::kUseVerticalTabs))
+ result->insert(kVerticalTabsExperimentName);
+ prefs->SetBoolean(prefs::kLabsMediaplayerEnabled, false);
+ prefs->SetBoolean(prefs::kLabsAdvancedFilesystemEnabled, false);
+ prefs->SetBoolean(prefs::kUseVerticalTabs, false);
+}
+#endif
+
// Extracts the list of enabled lab experiments from preferences and stores them
// in a set.
void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
@@ -387,6 +434,13 @@ void FlagsState::ConvertFlagsToSwitches(
return;
std::set<std::string> enabled_experiments;
+
+#if defined(OS_CHROMEOS)
+ // Some experiments were implemented via prefs on Chrome OS and we want to
+ // seamlessly migrate these prefs to about:flags for updated users.
+ MigrateChromeOSLabsPrefs(prefs, &enabled_experiments);
+#endif
+
GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
std::map<std::string, const Experiment*> experiment_map;
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/about_flags_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698