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

Unified Diff: chrome/browser/policy/configuration_policy_pref_store.cc

Issue 3140024: Implement policy for disabling auto fill. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: regenerate XIBs in order to avoid maxID corruption. Created 10 years, 4 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
Index: chrome/browser/policy/configuration_policy_pref_store.cc
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc
index 9b6eb11446cc2bd13951410ea656542e550af743..b702ca857272541bde3205b20da298798702a8dd 100644
--- a/chrome/browser/policy/configuration_policy_pref_store.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store.cc
@@ -373,6 +373,18 @@ bool ConfigurationPolicyPrefStore::ApplySyncPolicy(PolicyType policy,
return false;
}
+bool ConfigurationPolicyPrefStore::ApplyAutoFillPolicy(PolicyType policy,
+ Value* value) {
+ if (policy == ConfigurationPolicyStore::kPolicyAutoFillEnabled) {
+ bool auto_fill_enabled;
+ if (value->GetAsBoolean(&auto_fill_enabled) && !auto_fill_enabled)
+ prefs_->Set(prefs::kAutoFillEnabled, Value::CreateBooleanValue(false));
+ delete value;
+ return true;
+ }
+ return false;
+}
+
bool ConfigurationPolicyPrefStore::ApplyPolicyFromMap(PolicyType policy,
Value* value, const PolicyToPreferenceMapEntry map[], int size) {
const PolicyToPreferenceMapEntry* end = map + size;
@@ -397,6 +409,9 @@ void ConfigurationPolicyPrefStore::Apply(PolicyType policy, Value* value) {
if (ApplySyncPolicy(policy, value))
return;
+ if (ApplyAutoFillPolicy(policy, value))
+ return;
+
if (ApplyPolicyFromMap(policy, value, simple_policy_map_,
arraysize(simple_policy_map_)))
return;
« no previous file with comments | « chrome/browser/policy/configuration_policy_pref_store.h ('k') | chrome/browser/policy/configuration_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698