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

Unified Diff: chrome/browser/about_flags.cc

Issue 12728008: Revert 186837 "Move pref backing up flags from local state to de..." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/chromeos/settings/cros_settings_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
===================================================================
--- chrome/browser/about_flags.cc (revision 187881)
+++ chrome/browser/about_flags.cc (working copy)
@@ -43,8 +43,6 @@
#endif
#if defined(OS_CHROMEOS)
-#include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/chromeos/settings/cros_settings_names.h"
#include "chromeos/chromeos_switches.h"
#endif
@@ -1308,58 +1306,9 @@
DISALLOW_COPY_AND_ASSIGN(FlagsState);
};
-#if defined(OS_CHROMEOS)
-// Extracts the list of enabled lab experiments from device settings and stores
-// them in a set.
-void GetEnabledFlagsFromDeviceSettings(std::set<std::string>* result) {
- const ListValue* enabled_experiments;
- if (!chromeos::CrosSettings::Get()->GetList(chromeos::kStartUpFlags,
- &enabled_experiments)) {
- return;
- }
-
- for (ListValue::const_iterator it = enabled_experiments->begin();
- it != enabled_experiments->end();
- ++it) {
- std::string experiment_name;
- if (!(*it)->GetAsString(&experiment_name)) {
- LOG(WARNING) << "Invalid entry in " << chromeos::kStartUpFlags;
- continue;
- }
- result->insert(experiment_name);
- }
-}
-
-// Takes a set of enabled lab experiments and saves it into the device settings
-// storage on ChromeOS.
-void SetEnabledFlagsToDeviceSettings(
- const std::set<std::string>& enabled_experiments) {
- scoped_ptr<base::ListValue> experiments_list(new base::ListValue());
-
- for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
- it != enabled_experiments.end();
- ++it) {
- experiments_list->Append(new StringValue(*it));
- }
- chromeos::CrosSettings::Get()->Set(chromeos::kStartUpFlags,
- *experiments_list);
-}
-#endif
-
// Extracts the list of enabled lab experiments from preferences and stores them
-// in a set. On ChromeOS |prefs| can be NULL when reading machine level flags.
+// in a set.
void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
-#if defined(OS_CHROMEOS)
- // On ChromeOS flags are stored in the device settings blob.
- if (!prefs) {
- GetEnabledFlagsFromDeviceSettings(result);
- return;
- }
-#else
- // Never allow |prefs| to be NULL on other platforms.
- CHECK(prefs);
-#endif
-
const ListValue* enabled_experiments = prefs->GetList(
prefs::kEnabledLabsExperiments);
if (!enabled_experiments)
@@ -1377,21 +1326,9 @@
}
}
-// Takes a set of enabled lab experiments. On ChromeOS |prefs| can be NULL when
-// setting machine level flags.
+// Takes a set of enabled lab experiments
void SetEnabledFlags(
PrefService* prefs, const std::set<std::string>& enabled_experiments) {
-#if defined(OS_CHROMEOS)
- // On ChromeOS flags are stored in the device settings blob.
- if (!prefs) {
- SetEnabledFlagsToDeviceSettings(enabled_experiments);
- return;
- }
-#else
- // Never allow |prefs| to be NULL on other platforms.
- CHECK(prefs);
-#endif
-
ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
ListValue* experiments_list = update.Get();
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/chromeos/settings/cros_settings_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698