diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 03:27:11 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 03:27:11 +0000 |
commit | 548adcb9cb9343fe542f82cc35ffaa8f8279dfb6 (patch) | |
tree | b32f0079645d72525d009e718751b58ab8b02bd5 /chrome/browser/gtk | |
parent | e8c11e4801e7f4ca0c5f607d7bb489e3b1098a0c (diff) | |
download | chromium_src-548adcb9cb9343fe542f82cc35ffaa8f8279dfb6.zip chromium_src-548adcb9cb9343fe542f82cc35ffaa8f8279dfb6.tar.gz chromium_src-548adcb9cb9343fe542f82cc35ffaa8f8279dfb6.tar.bz2 |
Makes the auto fill dialogs match the mocks.
BUG=44620 46634
TEST=Make sure the auto fill dialogs work correctly.
Review URL: http://codereview.chromium.org/2975003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/keyword_editor_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/keyword_editor_view.h | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/options/content_page_gtk.cc | 62 | ||||
-rw-r--r-- | chrome/browser/gtk/options/content_page_gtk.h | 7 |
4 files changed, 8 insertions, 71 deletions
diff --git a/chrome/browser/gtk/keyword_editor_view.cc b/chrome/browser/gtk/keyword_editor_view.cc index e18b7e4..6786f45 100644 --- a/chrome/browser/gtk/keyword_editor_view.cc +++ b/chrome/browser/gtk/keyword_editor_view.cc @@ -417,9 +417,9 @@ gboolean KeywordEditorView::OnCheckRowIsSeparator(GtkTreeModel* model, } // static -gboolean KeywordEditorView::OnSelectionFilter(GtkTreeSelection *selection, - GtkTreeModel *model, - GtkTreePath *path, +gboolean KeywordEditorView::OnSelectionFilter(GtkTreeSelection* selection, + GtkTreeModel* model, + GtkTreePath* path, gboolean path_currently_selected, gpointer user_data) { GtkTreeIter iter; @@ -434,7 +434,7 @@ gboolean KeywordEditorView::OnSelectionFilter(GtkTreeSelection *selection, // static void KeywordEditorView::OnSelectionChanged( - GtkTreeSelection *selection, KeywordEditorView* editor) { + GtkTreeSelection* selection, KeywordEditorView* editor) { editor->EnableControls(); } diff --git a/chrome/browser/gtk/keyword_editor_view.h b/chrome/browser/gtk/keyword_editor_view.h index a5d5f9e..3ce4b49 100644 --- a/chrome/browser/gtk/keyword_editor_view.h +++ b/chrome/browser/gtk/keyword_editor_view.h @@ -104,7 +104,7 @@ class KeywordEditorView : public TableModelObserver, gpointer user_data); // Callback for when user selects something. - static void OnSelectionChanged(GtkTreeSelection *selection, + static void OnSelectionChanged(GtkTreeSelection* selection, KeywordEditorView* editor); // Callbacks for user actions modifying the table. diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc index 01672d0..540766c 100644 --- a/chrome/browser/gtk/options/content_page_gtk.cc +++ b/chrome/browser/gtk/options/content_page_gtk.cc @@ -115,8 +115,6 @@ ContentPageGtk::ContentPageGtk(Profile* profile) // Add preferences observers. ask_to_save_passwords_.Init(prefs::kPasswordManagerEnabled, profile->GetPrefs(), this); - enable_form_autofill_.Init(prefs::kAutoFillEnabled, - profile->GetPrefs(), this); if (browser_defaults::kCanToggleSystemTitleBar) { use_custom_chrome_frame_.Init(prefs::kUseCustomChromeFrame, @@ -164,17 +162,6 @@ void ContentPageGtk::NotifyPrefChanged(const std::wstring* pref_name) { GTK_TOGGLE_BUTTON(passwords_neversave_radio_), TRUE); } } - if (!pref_name || *pref_name == prefs::kAutoFillEnabled) { - if (enable_form_autofill_.GetValue()) { - gtk_toggle_button_set_active( - GTK_TOGGLE_BUTTON(form_autofill_enable_radio_), TRUE); - gtk_widget_set_sensitive(autofill_button_, TRUE); - } else { - gtk_toggle_button_set_active( - GTK_TOGGLE_BUTTON(form_autofill_disable_radio_), TRUE); - gtk_widget_set_sensitive(autofill_button_, FALSE); - } - } if (browser_defaults::kCanToggleSystemTitleBar && (!pref_name || *pref_name == prefs::kUseCustomChromeFrame)) { if (use_custom_chrome_frame_.GetValue()) { @@ -249,35 +236,16 @@ GtkWidget* ContentPageGtk::InitPasswordSavingGroup() { GtkWidget* ContentPageGtk::InitFormAutoFillGroup() { GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); - // Enable radio button. - form_autofill_enable_radio_ = gtk_radio_button_new_with_label(NULL, - l10n_util::GetStringUTF8(IDS_OPTIONS_AUTOFILL_ENABLE).c_str()); - g_signal_connect(G_OBJECT(form_autofill_enable_radio_), "toggled", - G_CALLBACK(OnAutoFillRadioToggledThunk), this); - gtk_box_pack_start(GTK_BOX(vbox), form_autofill_enable_radio_, FALSE, - FALSE, 0); - - // Disable radio button. - form_autofill_disable_radio_ = gtk_radio_button_new_with_label_from_widget( - GTK_RADIO_BUTTON(form_autofill_enable_radio_), - l10n_util::GetStringUTF8(IDS_OPTIONS_AUTOFILL_DISABLE).c_str()); - g_signal_connect(G_OBJECT(form_autofill_disable_radio_), "toggled", - G_CALLBACK(OnAutoFillRadioToggledThunk), this); - gtk_box_pack_start(GTK_BOX(vbox), form_autofill_disable_radio_, FALSE, - FALSE, 0); - GtkWidget* button_hbox = gtk_hbox_new(FALSE, gtk_util::kControlSpacing); gtk_container_add(GTK_CONTAINER(vbox), button_hbox); // AutoFill button. - autofill_button_ = gtk_button_new_with_label( + GtkWidget* autofill_button = gtk_button_new_with_label( l10n_util::GetStringUTF8(IDS_AUTOFILL_OPTIONS).c_str()); - if (!profile()->GetPrefs()->GetBoolean(prefs::kAutoFillEnabled)) - gtk_widget_set_sensitive(autofill_button_, FALSE); - 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; } @@ -560,30 +528,6 @@ void ContentPageGtk::OnPasswordRadioToggled(GtkWidget* widget) { ask_to_save_passwords_.SetValue(enabled); } -void ContentPageGtk::OnAutoFillRadioToggled(GtkWidget* widget) { - if (initializing_) - return; - - // We get two signals when selecting a radio button, one for the old radio - // being toggled off and one for the new one being toggled on. Ignore the - // signal for the toggling off the old button. - if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) - return; - - bool enabled = gtk_toggle_button_get_active( - GTK_TOGGLE_BUTTON(form_autofill_enable_radio_)); - if (enabled) { - UserMetricsRecordAction(UserMetricsAction("Options_FormAutofill_Enable"), - profile()->GetPrefs()); - gtk_widget_set_sensitive(autofill_button_, TRUE); - } else { - UserMetricsRecordAction(UserMetricsAction("Options_FormAutofill_Disable"), - profile()->GetPrefs()); - gtk_widget_set_sensitive(autofill_button_, FALSE); - } - enable_form_autofill_.SetValue(enabled); -} - void ContentPageGtk::OnSyncStartStopButtonClicked(GtkWidget* widget) { DCHECK(sync_service_); diff --git a/chrome/browser/gtk/options/content_page_gtk.h b/chrome/browser/gtk/options/content_page_gtk.h index ec1ea01..024eec8 100644 --- a/chrome/browser/gtk/options/content_page_gtk.h +++ b/chrome/browser/gtk/options/content_page_gtk.h @@ -57,7 +57,6 @@ class ContentPageGtk : public OptionsPageBase, CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnShowPasswordsButtonClicked); CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnPasswordRadioToggled); CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnAutoFillButtonClicked); - CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnAutoFillRadioToggled); CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnSyncStartStopButtonClicked); CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnSyncCustomizeButtonClicked); CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnSyncActionLinkClicked); @@ -68,11 +67,6 @@ class ContentPageGtk : public OptionsPageBase, GtkWidget* passwords_asktosave_radio_; GtkWidget* passwords_neversave_radio_; - // Widgets for the Form AutoFill group. - GtkWidget* form_autofill_enable_radio_; - GtkWidget* form_autofill_disable_radio_; - GtkWidget* autofill_button_; - // Widgets for the Appearance group. GtkWidget* system_title_bar_show_radio_; GtkWidget* system_title_bar_hide_radio_; @@ -97,7 +91,6 @@ class ContentPageGtk : public OptionsPageBase, // Pref members. BooleanPrefMember ask_to_save_passwords_; - BooleanPrefMember enable_form_autofill_; BooleanPrefMember use_custom_chrome_frame_; // Flag to ignore gtk callbacks while we are loading prefs, to avoid |