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

Unified Diff: chrome/browser/views/options/content_page_view.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
« no previous file with comments | « chrome/browser/views/options/content_page_view.h ('k') | chrome/common/policy_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/options/content_page_view.cc
diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc
index 67752321708d64f59394aa0d61033d1edf4340b7..d49c02457c6dbb25a121884109c98389153c70a8 100644
--- a/chrome/browser/views/options/content_page_view.cc
+++ b/chrome/browser/views/options/content_page_view.cc
@@ -218,6 +218,8 @@ void ContentPageView::InitControlLayout() {
// Init member prefs so we can update the controls if prefs change.
ask_to_save_passwords_.Init(prefs::kPasswordManagerEnabled,
profile()->GetPrefs(), this);
+ form_autofill_enabled_.Init(prefs::kAutoFillEnabled,
+ profile()->GetPrefs(), this);
is_using_default_theme_.Init(prefs::kCurrentThemeID,
profile()->GetPrefs(), this);
@@ -236,6 +238,12 @@ void ContentPageView::NotifyPrefChanged(const std::string* pref_name) {
passwords_neversave_radio_->SetChecked(true);
}
}
+ if (!pref_name || *pref_name == prefs::kAutoFillEnabled) {
+ bool disabled_by_policy = form_autofill_enabled_.IsManaged() &&
+ !form_autofill_enabled_.GetValue();
+ change_autofill_settings_button_->SetEnabled(
+ !disabled_by_policy && profile()->GetPersonalDataManager());
+ }
if (!pref_name || *pref_name == prefs::kCurrentThemeID) {
themes_reset_button_->SetEnabled(
is_using_default_theme_.GetValue().length() > 0);
@@ -311,9 +319,6 @@ void ContentPageView::InitPasswordSavingGroup() {
void ContentPageView::InitFormAutofillGroup() {
change_autofill_settings_button_ = new views::NativeButton(
this, l10n_util::GetString(IDS_AUTOFILL_OPTIONS));
- if (!profile()->GetPersonalDataManager())
- change_autofill_settings_button_->SetEnabled(false);
-
using views::GridLayout;
using views::ColumnSet;
« no previous file with comments | « chrome/browser/views/options/content_page_view.h ('k') | chrome/common/policy_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698