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

Unified Diff: chrome/browser/gtk/options/content_page_gtk.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/gtk/options/content_page_gtk.h ('k') | chrome/browser/managed_prefs_banner_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/options/content_page_gtk.cc
diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc
index a9e95143e14c9e1cf0b94321a317f5ed5b7f9ae4..afe737e4a9e67c5493b761141a55578e85aa8530 100644
--- a/chrome/browser/gtk/options/content_page_gtk.cc
+++ b/chrome/browser/gtk/options/content_page_gtk.cc
@@ -101,6 +101,8 @@ ContentPageGtk::ContentPageGtk(Profile* profile)
// Add preferences observers.
ask_to_save_passwords_.Init(prefs::kPasswordManagerEnabled,
profile->GetPrefs(), this);
+ form_autofill_enabled_.Init(prefs::kAutoFillEnabled,
+ profile->GetPrefs(), this);
if (browser_defaults::kCanToggleSystemTitleBar) {
use_custom_chrome_frame_.Init(prefs::kUseCustomChromeFrame,
profile->GetPrefs(), this);
@@ -161,6 +163,11 @@ void ContentPageGtk::NotifyPrefChanged(const std::string* pref_name) {
GTK_TOGGLE_BUTTON(passwords_neversave_radio_), TRUE);
}
}
+ if (!pref_name || *pref_name == prefs::kAutoFillEnabled) {
+ bool disabled_by_policy = form_autofill_enabled_.IsManaged() &&
+ !form_autofill_enabled_.GetValue();
+ gtk_widget_set_sensitive(autofill_button_, !disabled_by_policy);
+ }
if (browser_defaults::kCanToggleSystemTitleBar &&
(!pref_name || *pref_name == prefs::kUseCustomChromeFrame)) {
if (use_custom_chrome_frame_.GetValue()) {
@@ -247,12 +254,12 @@ GtkWidget* ContentPageGtk::InitFormAutoFillGroup() {
gtk_container_add(GTK_CONTAINER(vbox), button_hbox);
// AutoFill button.
- GtkWidget* autofill_button = gtk_button_new_with_label(
+ autofill_button_ = gtk_button_new_with_label(
l10n_util::GetStringUTF8(IDS_AUTOFILL_OPTIONS).c_str());
- g_signal_connect(G_OBJECT(autofill_button), "clicked",
+ g_signal_connect(G_OBJECT(autofill_button_), "clicked",
G_CALLBACK(OnAutoFillButtonClickedThunk), this);
- gtk_box_pack_start(GTK_BOX(button_hbox), autofill_button, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(button_hbox), autofill_button_, FALSE, FALSE, 0);
return vbox;
}
« no previous file with comments | « chrome/browser/gtk/options/content_page_gtk.h ('k') | chrome/browser/managed_prefs_banner_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698