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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 12549017: Adjust the profile sync service to properly set per user or per machine flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed stupid copy/paste error. 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/browser/sync/profile_sync_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index f7e1fa0b7e1d2bf0fdec0316caf5f159e18145e9..be58943a1f1bbbdd446b3a467ed380007be6a903 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -79,6 +79,10 @@
#include "sync/internal_api/public/read_transaction.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/user_manager.h"
+#endif
+
using browser_sync::ChangeProcessor;
using browser_sync::DataTypeController;
using browser_sync::DataTypeManager;
@@ -933,9 +937,7 @@ void ProfileSyncService::OnExperimentsChanged(
std::string experiment_name = GetExperimentNameForDataType(it.Get());
if (experiment_name.empty())
continue;
- about_flags::SetExperimentEnabled(g_browser_process->local_state(),
- experiment_name,
- true);
+ SetExperimentFlag(experiment_name);
}
// Check if the user has "Keep Everything Synced" enabled. If so, we want
@@ -960,9 +962,7 @@ void ProfileSyncService::OnExperimentsChanged(
// Now enable any non-datatype features.
if (experiments.sync_tab_favicons) {
DVLOG(1) << "Enabling syncing of tab favicons.";
- about_flags::SetExperimentEnabled(g_browser_process->local_state(),
- "sync-tab-favicons",
- true);
+ SetExperimentFlag("sync-tab-favicons");
#if defined(OS_ANDROID)
// Android does not support about:flags and experiments, so we need to force
// setting the experiments as command line switches.
@@ -970,17 +970,11 @@ void ProfileSyncService::OnExperimentsChanged(
#endif
}
- if (experiments.keystore_encryption) {
- about_flags::SetExperimentEnabled(g_browser_process->local_state(),
- syncer::kKeystoreEncryptionFlag,
- true);
- }
+ if (experiments.keystore_encryption)
+ SetExperimentFlag(syncer::kKeystoreEncryptionFlag);
- if (experiments.full_history_sync) {
- about_flags::SetExperimentEnabled(g_browser_process->local_state(),
- syncer::kFullHistorySyncFlag,
- true);
- }
+ if (experiments.full_history_sync)
+ SetExperimentFlag(syncer::kFullHistorySyncFlag);
current_experiments_ = experiments;
}
@@ -2027,3 +2021,16 @@ void ProfileSyncService::ResetForTest() {
signin,
behavior);
}
+
+void ProfileSyncService::SetExperimentFlag(const std::string& experiment) {
+#if defined(OS_CHROMEOS)
+ if (chromeos::UserManager::Get()->IsCurrentUserOwner())
+ about_flags::SetExperimentEnabled(NULL, experiment, true);
+ else
+ about_flags::SetExperimentEnabled(profile_->GetPrefs(), experiment, true);
+#else
+ about_flags::SetExperimentEnabled(g_browser_process->local_state(),
+ experiment,
+ true);
+#endif
+}
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698