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

Unified Diff: chrome/browser/configuration_policy_pref_store.cc

Issue 2905003: Implement support for disabling sync through configuration management. (Closed)
Patch Set: Fix PrefsControllerTest on MAC. Created 10 years, 5 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/configuration_policy_pref_store.h ('k') | chrome/browser/configuration_policy_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/configuration_policy_pref_store.cc
diff --git a/chrome/browser/configuration_policy_pref_store.cc b/chrome/browser/configuration_policy_pref_store.cc
index d2ada7c5809c60aa89bee6a1815f23ec786fe771..43c9caa15d036cc12c1dd67d35a5dfbefbf0538b 100644
--- a/chrome/browser/configuration_policy_pref_store.cc
+++ b/chrome/browser/configuration_policy_pref_store.cc
@@ -224,6 +224,19 @@ bool ConfigurationPolicyPrefStore::ApplyProxyPolicy(PolicyType policy,
return result;
}
+bool ConfigurationPolicyPrefStore::ApplySyncPolicy(PolicyType policy,
+ Value* value) {
+ if (policy == ConfigurationPolicyStore::kPolicySyncDisabled) {
+ bool disable_sync;
+ if (value->GetAsBoolean(&disable_sync) && disable_sync)
+ prefs_->Set(prefs::kSyncManaged, value);
+ else
+ delete value;
+ return true;
+ }
+ return false;
+}
+
bool ConfigurationPolicyPrefStore::ApplyPolicyFromMap(PolicyType policy,
Value* value, const PolicyToPreferenceMapEntry map[], int size) {
const PolicyToPreferenceMapEntry* end = map + size;
@@ -242,6 +255,9 @@ void ConfigurationPolicyPrefStore::Apply(PolicyType policy, Value* value) {
if (ApplyProxyPolicy(policy, value))
return;
+ if (ApplySyncPolicy(policy, value))
+ return;
+
if (ApplyPolicyFromMap(policy, value, simple_policy_map_,
arraysize(simple_policy_map_)))
return;
@@ -249,4 +265,3 @@ void ConfigurationPolicyPrefStore::Apply(PolicyType policy, Value* value) {
// Other policy implementations go here.
NOTIMPLEMENTED();
}
-
« no previous file with comments | « chrome/browser/configuration_policy_pref_store.h ('k') | chrome/browser/configuration_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698