diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 21:08:46 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 21:08:46 +0000 |
commit | 43250c7bc9096609ca89af72153c9a6c0a4d53e2 (patch) | |
tree | 803eb726e3852991dd50d932938dc1dd20d5eeb6 | |
parent | 3900683cfc013217805ff828d8276056b10a5251 (diff) | |
download | chromium_src-43250c7bc9096609ca89af72153c9a6c0a4d53e2.zip chromium_src-43250c7bc9096609ca89af72153c9a6c0a4d53e2.tar.gz chromium_src-43250c7bc9096609ca89af72153c9a6c0a4d53e2.tar.bz2 |
gtk: Rename OnDialogResponse() to OnResponse() to standardize on a consistent naming scheme.
This allow us to have a single pattern for handling the gtk "response" callback.
So now in every gtk dialog on chromium, it looks like this:
my_dialog_gtk.h:
CHROMEGTK_CALLBACK_1(MyDialogGtk, void, OnResponse, int);
my_dialog_gtk.cc:
void MyDialogGtk::OnResponse(GtkWidget* dialog, int response_id) {
}
And to subscribe to this event:
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/6627038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77180 0039d316-1c4b-4281-b951-d872f2087c98
38 files changed, 114 insertions, 126 deletions
diff --git a/chrome/browser/autofill/autofill_dialog_gtk.cc b/chrome/browser/autofill/autofill_dialog_gtk.cc index 0195014..6bcf897 100644 --- a/chrome/browser/autofill/autofill_dialog_gtk.cc +++ b/chrome/browser/autofill/autofill_dialog_gtk.cc @@ -115,7 +115,7 @@ class AutoFillDialog : public PersonalDataManager::Observer, // data is available if the response is GTK_RESPONSE_APPLY or GTK_RESPONSE_OK. // We close the dialog if the response is GTK_RESPONSE_OK or // GTK_RESPONSE_CANCEL. - CHROMEG_CALLBACK_1(AutoFillDialog, void, OnResponse, GtkDialog*, gint); + CHROMEGTK_CALLBACK_1(AutoFillDialog, void, OnResponse, int); CHROMEGTK_CALLBACK_0(AutoFillDialog, void, OnAutoFillCheckToggled); CHROMEG_CALLBACK_2(AutoFillDialog, void, OnRowActivated, GtkTreeView*, @@ -252,11 +252,11 @@ void AutoFillDialog::OnDestroy(GtkWidget* widget) { MessageLoop::current()->DeleteSoon(FROM_HERE, this); } -void AutoFillDialog::OnResponse(GtkDialog* dialog, gint response_id) { +void AutoFillDialog::OnResponse(GtkWidget* dialog, int response_id) { if (response_id == GTK_RESPONSE_OK || response_id == GTK_RESPONSE_CANCEL || response_id == GTK_RESPONSE_DELETE_EVENT) { - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); } if (response_id == kAutoFillDialogAboutLink) diff --git a/chrome/browser/autofill/autofill_editor_gtk.cc b/chrome/browser/autofill/autofill_editor_gtk.cc index 2043a4e..11f2184f 100644 --- a/chrome/browser/autofill/autofill_editor_gtk.cc +++ b/chrome/browser/autofill/autofill_editor_gtk.cc @@ -191,7 +191,7 @@ class AutoFillProfileEditor { void UpdateOkButton(); CHROMEGTK_CALLBACK_0(AutoFillProfileEditor, void, OnDestroy); - CHROMEG_CALLBACK_1(AutoFillProfileEditor, void, OnResponse, GtkDialog*, gint); + CHROMEGTK_CALLBACK_1(AutoFillProfileEditor, void, OnResponse, int); CHROMEG_CALLBACK_0(AutoFillProfileEditor, void, OnPhoneChanged, GtkEditable*); CHROMEG_CALLBACK_0(AutoFillProfileEditor, void, OnFaxChanged, GtkEditable*); CHROMEG_CALLBACK_0(AutoFillProfileEditor, void, OnFieldChanged, GtkEditable*); @@ -492,7 +492,7 @@ void AutoFillProfileEditor::OnDestroy(GtkWidget* widget) { MessageLoop::current()->DeleteSoon(FROM_HERE, this); } -void AutoFillProfileEditor::OnResponse(GtkDialog* dialog, gint response_id) { +void AutoFillProfileEditor::OnResponse(GtkWidget* dialog, int response_id) { if (response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_OK) ApplyEdits(); @@ -500,7 +500,7 @@ void AutoFillProfileEditor::OnResponse(GtkDialog* dialog, gint response_id) { response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_CANCEL || response_id == GTK_RESPONSE_DELETE_EVENT) { - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); } } @@ -557,8 +557,7 @@ class AutoFillCreditCardEditor { void UpdateOkButton(); CHROMEGTK_CALLBACK_0(AutoFillCreditCardEditor, void, OnDestroy); - CHROMEG_CALLBACK_1(AutoFillCreditCardEditor, void, OnResponse, GtkDialog*, - gint); + CHROMEGTK_CALLBACK_1(AutoFillCreditCardEditor, void, OnResponse, int); CHROMEG_CALLBACK_0(AutoFillCreditCardEditor, void, OnFieldChanged, GtkEditable*); CHROMEG_CALLBACK_2(AutoFillCreditCardEditor, void, OnDeleteTextFromNumber, @@ -804,7 +803,7 @@ void AutoFillCreditCardEditor::OnDestroy(GtkWidget* widget) { MessageLoop::current()->DeleteSoon(FROM_HERE, this); } -void AutoFillCreditCardEditor::OnResponse(GtkDialog* dialog, gint response_id) { +void AutoFillCreditCardEditor::OnResponse(GtkWidget* dialog, int response_id) { if (response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_OK) ApplyEdits(); @@ -812,7 +811,7 @@ void AutoFillCreditCardEditor::OnResponse(GtkDialog* dialog, gint response_id) { response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_CANCEL || response_id == GTK_RESPONSE_DELETE_EVENT) { - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); } } diff --git a/chrome/browser/printing/print_dialog_gtk.cc b/chrome/browser/printing/print_dialog_gtk.cc index 051b244..12e925a 100644 --- a/chrome/browser/printing/print_dialog_gtk.cc +++ b/chrome/browser/printing/print_dialog_gtk.cc @@ -98,7 +98,7 @@ PrintDialogGtk::~PrintDialogGtk() { } } -void PrintDialogGtk::OnResponse(GtkWidget* dialog, gint response_id) { +void PrintDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { gtk_widget_hide(dialog_); switch (response_id) { diff --git a/chrome/browser/printing/print_dialog_gtk.h b/chrome/browser/printing/print_dialog_gtk.h index e499809..d9f4226 100644 --- a/chrome/browser/printing/print_dialog_gtk.h +++ b/chrome/browser/printing/print_dialog_gtk.h @@ -46,7 +46,7 @@ class PrintDialogGtk : public base::RefCountedThreadSafe<PrintDialogGtk> { ~PrintDialogGtk(); // Handles dialog response. - CHROMEGTK_CALLBACK_1(PrintDialogGtk, void, OnResponse, gint); + CHROMEGTK_CALLBACK_1(PrintDialogGtk, void, OnResponse, int); // Saves data in |metafile| to disk for document named |document_name|. void SaveDocumentToDisk(const NativeMetafile* metafile, diff --git a/chrome/browser/ui/gtk/about_chrome_dialog.cc b/chrome/browser/ui/gtk/about_chrome_dialog.cc index 4bd9bcf..49909c6 100644 --- a/chrome/browser/ui/gtk/about_chrome_dialog.cc +++ b/chrome/browser/ui/gtk/about_chrome_dialog.cc @@ -50,9 +50,9 @@ const char* kEndLinkOss = "END_LINK_OSS"; const char* kBeginLink = "BEGIN_LINK"; const char* kEndLink = "END_LINK"; -void OnDialogResponse(GtkDialog* dialog, int response_id) { +void OnResponse(GtkWidget* dialog, int response_id) { // We're done. - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); } GtkWidget* MakeMarkupLabel(const char* format, const std::string& str) { @@ -280,7 +280,7 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { gtk_container_add(GTK_CONTAINER(alignment), vbox); gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); - g_signal_connect(dialog, "response", G_CALLBACK(OnDialogResponse), NULL); + g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_widget_show_all(dialog); gtk_widget_grab_focus(close_button); diff --git a/chrome/browser/ui/gtk/certificate_viewer.cc b/chrome/browser/ui/gtk/certificate_viewer.cc index ab64d2a..04b1a260 100644 --- a/chrome/browser/ui/gtk/certificate_viewer.cc +++ b/chrome/browser/ui/gtk/certificate_viewer.cc @@ -121,10 +121,9 @@ class CertificateViewer { // CertificateViewer implementation. // Close button callback. -void OnDialogResponse(GtkDialog* dialog, gint response_id, - gpointer user_data) { +void OnResponse(GtkWidget* dialog, int response_id) { // "Close" was clicked. - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); } void OnDestroy(GtkDialog* dialog, CertificateViewer* cert_viewer) { @@ -173,7 +172,7 @@ CertificateViewer::CertificateViewer( l10n_util::GetStringUTF8( IDS_CERT_INFO_DETAILS_TAB_LABEL)).c_str())); - g_signal_connect(dialog_, "response", G_CALLBACK(OnDialogResponse), NULL); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), NULL); g_signal_connect(dialog_, "destroy", G_CALLBACK(OnDestroy), this); } diff --git a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc index 992db45..86d45d8 100644 --- a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.cc @@ -169,8 +169,7 @@ ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, gtk_box_reorder_child(GTK_BOX(content_area), GTK_DIALOG(dialog_)->action_area, -1); - g_signal_connect(dialog_, "response", - G_CALLBACK(OnDialogResponseThunk), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); UpdateDialogButtons(); @@ -181,9 +180,9 @@ ClearBrowsingDataDialogGtk::ClearBrowsingDataDialogGtk(GtkWindow* parent, ClearBrowsingDataDialogGtk::~ClearBrowsingDataDialogGtk() { } -void ClearBrowsingDataDialogGtk::OnDialogResponse(GtkWidget* widget, - int response) { - if (response == GTK_RESPONSE_ACCEPT) { +void ClearBrowsingDataDialogGtk::OnResponse(GtkWidget* dialog, + int response_id) { + if (response_id == GTK_RESPONSE_ACCEPT) { PrefService* prefs = profile_->GetPrefs(); prefs->SetBoolean(prefs::kDeleteBrowsingHistory, IsChecked(del_history_checkbox_)); @@ -211,7 +210,7 @@ void ClearBrowsingDataDialogGtk::OnDialogResponse(GtkWidget* widget, } delete this; - gtk_widget_destroy(GTK_WIDGET(widget)); + gtk_widget_destroy(dialog); } void ClearBrowsingDataDialogGtk::OnDialogWidgetClicked(GtkWidget* widget) { diff --git a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h index 4147d45..2782385 100644 --- a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h +++ b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h @@ -25,8 +25,8 @@ class ClearBrowsingDataDialogGtk { ClearBrowsingDataDialogGtk(GtkWindow* parent, Profile* profile); ~ClearBrowsingDataDialogGtk(); - // Handler to respond to Ok and Cancel responses from the dialog. - CHROMEGTK_CALLBACK_1(ClearBrowsingDataDialogGtk, void, OnDialogResponse, int); + // Handler to respond to OK and Cancel responses from the dialog. + CHROMEGTK_CALLBACK_1(ClearBrowsingDataDialogGtk, void, OnResponse, int); // Handler to respond to widget clicked actions from the dialog. CHROMEGTK_CALLBACK_0(ClearBrowsingDataDialogGtk, void, OnDialogWidgetClicked); diff --git a/chrome/browser/ui/gtk/crypto_module_password_dialog.cc b/chrome/browser/ui/gtk/crypto_module_password_dialog.cc index 5b7f51b..2abe3f9 100644 --- a/chrome/browser/ui/gtk/crypto_module_password_dialog.cc +++ b/chrome/browser/ui/gtk/crypto_module_password_dialog.cc @@ -197,7 +197,7 @@ void CryptoModulePasswordDialog::OnResponse(GtkWidget* dialog, // gtk_entry_buffer_normal_delete_text: // http://git.gnome.org/browse/gtk+/tree/gtk/gtkentrybuffer.c#n187) gtk_editable_delete_text(GTK_EDITABLE(password_entry_), 0, -1); - gtk_widget_destroy(GTK_WIDGET(dialog_)); + gtk_widget_destroy(dialog_); } void CryptoModulePasswordDialog::OnWindowDestroy(GtkWidget* widget) { diff --git a/chrome/browser/ui/gtk/dialogs_gtk.cc b/chrome/browser/ui/gtk/dialogs_gtk.cc index 10d9d57..c33a7d6 100644 --- a/chrome/browser/ui/gtk/dialogs_gtk.cc +++ b/chrome/browser/ui/gtk/dialogs_gtk.cc @@ -109,15 +109,15 @@ class SelectFileDialogImpl : public SelectFileDialog { // Callback for when the user responds to a Save As or Open File dialog. CHROMEGTK_CALLBACK_1(SelectFileDialogImpl, void, - OnSelectSingleFileDialogResponse, gint); + OnSelectSingleFileDialogResponse, int); // Callback for when the user responds to a Select Folder dialog. CHROMEGTK_CALLBACK_1(SelectFileDialogImpl, void, - OnSelectSingleFolderDialogResponse, gint); + OnSelectSingleFolderDialogResponse, int); // Callback for when the user responds to a Open Multiple Files dialog. CHROMEGTK_CALLBACK_1(SelectFileDialogImpl, void, - OnSelectMultiFileDialogResponse, gint); + OnSelectMultiFileDialogResponse, int); // Callback for when the file chooser gets destroyed. CHROMEGTK_CALLBACK_0(SelectFileDialogImpl, void, OnFileChooserDestroy); @@ -528,18 +528,18 @@ void SelectFileDialogImpl::SelectSingleFileHelper(GtkWidget* dialog, FileSelected(dialog, path); } -void SelectFileDialogImpl::OnSelectSingleFileDialogResponse( - GtkWidget* dialog, gint response_id) { +void SelectFileDialogImpl::OnSelectSingleFileDialogResponse(GtkWidget* dialog, + int response_id) { return SelectSingleFileHelper(dialog, response_id, false); } -void SelectFileDialogImpl::OnSelectSingleFolderDialogResponse( - GtkWidget* dialog, gint response_id) { +void SelectFileDialogImpl::OnSelectSingleFolderDialogResponse(GtkWidget* dialog, + int response_id) { return SelectSingleFileHelper(dialog, response_id, true); } -void SelectFileDialogImpl::OnSelectMultiFileDialogResponse( - GtkWidget* dialog, gint response_id) { +void SelectFileDialogImpl::OnSelectMultiFileDialogResponse(GtkWidget* dialog, + int response_id) { if (IsCancelResponse(response_id)) { FileNotSelected(dialog); return; diff --git a/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.cc b/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.cc index de3cb31..9363467 100644 --- a/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.cc @@ -76,9 +76,9 @@ DownloadInProgressDialogGtk::DownloadInProgressDialogGtk(Browser* browser) gtk_widget_show_all(dialog); } -void DownloadInProgressDialogGtk::OnResponse(GtkWidget* widget, - int response) { - gtk_widget_destroy(widget); - browser_->InProgressDownloadResponse(response == GTK_RESPONSE_ACCEPT); +void DownloadInProgressDialogGtk::OnResponse(GtkWidget* dialog, + int response_id) { + gtk_widget_destroy(dialog); + browser_->InProgressDownloadResponse(response_id == GTK_RESPONSE_ACCEPT); delete this; } diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc index cefcab3..a3e4940 100644 --- a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc +++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc @@ -261,7 +261,7 @@ void EditSearchEngineDialog::OnEntryChanged(GtkEditable* editable) { EnableControls(); } -void EditSearchEngineDialog::OnResponse(GtkDialog* dialog, int response_id) { +void EditSearchEngineDialog::OnResponse(GtkWidget* dialog, int response_id) { if (response_id == GTK_RESPONSE_OK) { controller_->AcceptAddOrEdit(GetTitleInput(), GetKeywordInput(), diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.h b/chrome/browser/ui/gtk/edit_search_engine_dialog.h index c1ab779..df54eba 100644 --- a/chrome/browser/ui/gtk/edit_search_engine_dialog.h +++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.h @@ -49,7 +49,7 @@ class EditSearchEngineDialog { GtkEditable*); // Callback for dialog buttons. - CHROMEG_CALLBACK_1(EditSearchEngineDialog, void, OnResponse, GtkDialog*, int); + CHROMEGTK_CALLBACK_1(EditSearchEngineDialog, void, OnResponse, int); // Callback for window destruction. CHROMEGTK_CALLBACK_0(EditSearchEngineDialog, void, OnWindowDestroy); diff --git a/chrome/browser/ui/gtk/extension_install_prompt2_gtk.cc b/chrome/browser/ui/gtk/extension_install_prompt2_gtk.cc index 95246b4..4d2c376 100644 --- a/chrome/browser/ui/gtk/extension_install_prompt2_gtk.cc +++ b/chrome/browser/ui/gtk/extension_install_prompt2_gtk.cc @@ -41,15 +41,15 @@ GtkWidget* MakeMarkupLabel(const char* format, const std::string& str) { return label; } -void OnDialogResponse(GtkDialog* dialog, int response_id, - ExtensionInstallUI::Delegate* delegate) { +void OnResponse(GtkWidget* dialog, int response_id, + ExtensionInstallUI::Delegate* delegate) { if (response_id == GTK_RESPONSE_ACCEPT) { delegate->InstallUIProceed(); } else { delegate->InstallUIAbort(); } - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); } void ShowInstallPromptDialog2(GtkWindow* parent, SkBitmap* skia_icon, @@ -160,7 +160,7 @@ void ShowInstallPromptDialog2(GtkWindow* parent, SkBitmap* skia_icon, } } - g_signal_connect(dialog, "response", G_CALLBACK(OnDialogResponse), delegate); + g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), delegate); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CLOSE); diff --git a/chrome/browser/ui/gtk/extension_install_prompt_gtk.cc b/chrome/browser/ui/gtk/extension_install_prompt_gtk.cc index 9790ced..152dd343 100644 --- a/chrome/browser/ui/gtk/extension_install_prompt_gtk.cc +++ b/chrome/browser/ui/gtk/extension_install_prompt_gtk.cc @@ -26,15 +26,15 @@ namespace { // Left or right margin. const int kPanelHorizMargin = 13; -void OnDialogResponse(GtkDialog* dialog, int response_id, - ExtensionInstallUI::Delegate* delegate) { +void OnResponse(GtkWidget* dialog, int response_id, + ExtensionInstallUI::Delegate* delegate) { if (response_id == GTK_RESPONSE_ACCEPT) { delegate->InstallUIProceed(); } else { delegate->InstallUIAbort(); } - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); } void ShowInstallPromptDialog(GtkWindow* parent, SkBitmap* skia_icon, @@ -79,7 +79,7 @@ void ShowInstallPromptDialog(GtkWindow* parent, SkBitmap* skia_icon, gtk_misc_set_alignment(GTK_MISC(heading_label), 0.0, 0.5); gtk_box_pack_start(GTK_BOX(right_column_area), heading_label, TRUE, TRUE, 0); - g_signal_connect(dialog, "response", G_CALLBACK(OnDialogResponse), delegate); + g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), delegate); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_widget_show_all(dialog); } diff --git a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc index 5e38060..a52eba1 100644 --- a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc @@ -98,20 +98,21 @@ ExternalProtocolDialogGtk::ExternalProtocolDialogGtk(const GURL& url) gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), vbox, FALSE, FALSE, 0); - g_signal_connect(dialog_, "response", - G_CALLBACK(OnDialogResponseThunk), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); gtk_widget_show_all(dialog_); } -void ExternalProtocolDialogGtk::OnDialogResponse(GtkWidget* widget, - int response) { +ExternalProtocolDialogGtk::~ExternalProtocolDialogGtk() { +} + +void ExternalProtocolDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_))) { - if (response == GTK_RESPONSE_ACCEPT) { + if (response_id == GTK_RESPONSE_ACCEPT) { ExternalProtocolHandler::SetBlockState( url_.scheme(), ExternalProtocolHandler::DONT_BLOCK); - } else if (response == GTK_RESPONSE_REJECT) { + } else if (response_id == GTK_RESPONSE_REJECT) { ExternalProtocolHandler::SetBlockState( url_.scheme(), ExternalProtocolHandler::BLOCK); } @@ -119,7 +120,7 @@ void ExternalProtocolDialogGtk::OnDialogResponse(GtkWidget* widget, // the dialog, do nothing. } - if (response == GTK_RESPONSE_ACCEPT) { + if (response_id == GTK_RESPONSE_ACCEPT) { UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url", base::TimeTicks::Now() - creation_time_); diff --git a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h index d0fa3ad..966d216 100644 --- a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h +++ b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h @@ -6,28 +6,27 @@ #define CHROME_BROWSER_UI_GTK_EXTERNAL_PROTOCOL_DIALOG_GTK_H_ #pragma once +#include "base/basictypes.h" #include "base/time.h" #include "googleurl/src/gurl.h" #include "ui/base/gtk/gtk_signal.h" -class TabContents; - typedef struct _GtkWidget GtkWidget; class ExternalProtocolDialogGtk { public: explicit ExternalProtocolDialogGtk(const GURL& url); - - protected: - virtual ~ExternalProtocolDialogGtk() {} + ~ExternalProtocolDialogGtk(); private: - CHROMEGTK_CALLBACK_1(ExternalProtocolDialogGtk, void, OnDialogResponse, int); + CHROMEGTK_CALLBACK_1(ExternalProtocolDialogGtk, void, OnResponse, int); GtkWidget* dialog_; GtkWidget* checkbox_; GURL url_; base::TimeTicks creation_time_; + + DISALLOW_COPY_AND_ASSIGN(ExternalProtocolDialogGtk); }; #endif // CHROME_BROWSER_UI_GTK_EXTERNAL_PROTOCOL_DIALOG_GTK_H_ diff --git a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc index d5a8887..4a4d0f7 100644 --- a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc @@ -44,7 +44,7 @@ class HungRendererDialogGtk { // Create the gtk dialog and add the widgets. void Init(); - CHROMEGTK_CALLBACK_1(HungRendererDialogGtk, void, OnDialogResponse, gint); + CHROMEGTK_CALLBACK_1(HungRendererDialogGtk, void, OnResponse, int); GtkDialog* dialog_; GtkListStore* model_; @@ -76,8 +76,7 @@ void HungRendererDialogGtk::Init() { GTK_RESPONSE_OK, NULL)); gtk_dialog_set_default_response(dialog_, GTK_RESPONSE_OK); - g_signal_connect(dialog_, "response", - G_CALLBACK(OnDialogResponseThunk), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); // We have an hbox with the frozen icon on the left. On the right, // we have a vbox with the unresponsive text on top and a table of @@ -182,8 +181,7 @@ void HungRendererDialogGtk::EndForTabContents(TabContents* contents) { // When the user clicks a button on the dialog or closes the dialog, this // callback is called. -void HungRendererDialogGtk::OnDialogResponse(GtkWidget* widget, - gint response_id) { +void HungRendererDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { DCHECK(g_instance == this); switch (response_id) { case kKillPagesButtonResponse: diff --git a/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc index 6fa3108..52feb82 100644 --- a/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_dialog_gtk.cc @@ -122,14 +122,13 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile, // Disable controls until source profiles are loaded. SetDialogControlsSensitive(false); - g_signal_connect(dialog_, "response", - G_CALLBACK(OnDialogResponseThunk), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); UpdateDialogButtons(); gtk_util::ShowDialogWithLocalizedSize(dialog_, IDS_IMPORT_DIALOG_WIDTH_CHARS, - -1, // height + -1, // height false); // resizable } @@ -138,9 +137,9 @@ ImportDialogGtk::~ImportDialogGtk() { importer_list_->SetObserver(NULL); } -void ImportDialogGtk::OnDialogResponse(GtkWidget* widget, int response) { +void ImportDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { gtk_widget_hide_all(dialog_); - if (response == GTK_RESPONSE_ACCEPT) { + if (response_id == GTK_RESPONSE_ACCEPT) { uint16 items = GetCheckedItems(); if (items == 0) { ImportCompleted(); diff --git a/chrome/browser/ui/gtk/importer/import_dialog_gtk.h b/chrome/browser/ui/gtk/importer/import_dialog_gtk.h index 403e2bcb..e2e37f1 100644 --- a/chrome/browser/ui/gtk/importer/import_dialog_gtk.h +++ b/chrome/browser/ui/gtk/importer/import_dialog_gtk.h @@ -27,7 +27,7 @@ class ImportDialogGtk : public ImporterList::Observer, virtual ~ImportDialogGtk(); // Handler to respond to OK or Cancel responses from the dialog. - CHROMEGTK_CALLBACK_1(ImportDialogGtk, void, OnDialogResponse, int); + CHROMEGTK_CALLBACK_1(ImportDialogGtk, void, OnResponse, int); // Handler to respond to widget clicked actions from the dialog. CHROMEGTK_CALLBACK_0(ImportDialogGtk, void, OnDialogWidgetClicked); diff --git a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc index 175bb93..ff607b0 100644 --- a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc @@ -52,16 +52,15 @@ ImportLockDialogGtk::ImportLockDialogGtk(GtkWindow* parent, gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0); - g_signal_connect(dialog_, "response", - G_CALLBACK(OnDialogResponseThunk), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); gtk_widget_show_all(dialog_); } ImportLockDialogGtk::~ImportLockDialogGtk() {} -void ImportLockDialogGtk::OnDialogResponse(GtkWidget* widget, int response) { - if (response == GTK_RESPONSE_ACCEPT) { +void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { + if (response_id == GTK_RESPONSE_ACCEPT) { MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( importer_host_.get(), &ImporterHost::OnLockViewEnd, true)); } else { diff --git a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h index fe0bec6..2b148ac 100644 --- a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h +++ b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h @@ -25,7 +25,7 @@ class ImportLockDialogGtk { ImportLockDialogGtk(GtkWindow* parent, ImporterHost* importer_host); ~ImportLockDialogGtk(); - CHROMEGTK_CALLBACK_1(ImportLockDialogGtk, void, OnDialogResponse, int); + CHROMEGTK_CALLBACK_1(ImportLockDialogGtk, void, OnResponse, int); // Import lock dialog. GtkWidget* dialog_; diff --git a/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc index 72871e9..27ebe8c 100644 --- a/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_progress_dialog_gtk.cc @@ -132,7 +132,7 @@ ImportProgressDialogGtk::ImportProgressDialogGtk( ImportProgressDialogGtk::~ImportProgressDialogGtk() {} -void ImportProgressDialogGtk::OnResponse(GtkWidget* widget, int response) { +void ImportProgressDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { if (!importing_) { CloseDialog(); return; @@ -140,7 +140,7 @@ void ImportProgressDialogGtk::OnResponse(GtkWidget* widget, int response) { // Only response to the dialog is to close it so we hide immediately. gtk_widget_hide_all(dialog_); - if (response == GTK_RESPONSE_REJECT) + if (response_id == GTK_RESPONSE_REJECT) importer_host_->Cancel(); } diff --git a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc index 446428c..31abb00 100644 --- a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc @@ -34,8 +34,7 @@ InstantConfirmDialogGtk::InstantConfirmDialogGtk( GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); - g_signal_connect(dialog_, "response", - G_CALLBACK(OnDialogResponseThunk), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); GtkBox* vbox = GTK_BOX(GTK_DIALOG(dialog_)->vbox); gtk_box_set_spacing(vbox, gtk_util::kControlSpacing); @@ -64,9 +63,8 @@ InstantConfirmDialogGtk::~InstantConfirmDialogGtk() { gtk_widget_destroy(dialog_); } -void InstantConfirmDialogGtk::OnDialogResponse(GtkWidget* dialog, - int response) { - if (response == GTK_RESPONSE_ACCEPT) +void InstantConfirmDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { + if (response_id == GTK_RESPONSE_ACCEPT) InstantController::Enable(profile_); delete this; diff --git a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h index 8ef0653..98d427f 100644 --- a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h +++ b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h @@ -10,6 +10,8 @@ #include "ui/base/gtk/gtk_signal.h" class Profile; + +typedef struct _GtkWidget GtkWidget; typedef struct _GtkWindow GtkWindow; // A dialog that explains some of the privacy implications surrounding instant. @@ -20,7 +22,7 @@ class InstantConfirmDialogGtk { ~InstantConfirmDialogGtk(); private: - CHROMEGTK_CALLBACK_1(InstantConfirmDialogGtk, void, OnDialogResponse, int); + CHROMEGTK_CALLBACK_1(InstantConfirmDialogGtk, void, OnResponse, int); CHROMEGTK_CALLBACK_0(InstantConfirmDialogGtk, void, OnLinkButtonClicked); GtkWidget* dialog_; diff --git a/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc b/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc index 33c05e6..74b8c0e 100644 --- a/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc @@ -134,8 +134,7 @@ JSModalDialogGtk::JSModalDialogGtk(JavaScriptAppModalDialog* dialog, } gtk_dialog_set_default_response(GTK_DIALOG(gtk_dialog_), GTK_RESPONSE_OK); - g_signal_connect(gtk_dialog_, "response", - G_CALLBACK(OnDialogResponseThunk), this); + g_signal_connect(gtk_dialog_, "response", G_CALLBACK(OnResponseThunk), this); } JSModalDialogGtk::~JSModalDialogGtk() { @@ -173,22 +172,21 @@ void JSModalDialogGtk::ActivateAppModalDialog() { void JSModalDialogGtk::CloseAppModalDialog() { DCHECK(gtk_dialog_); - OnDialogResponse(gtk_dialog_, GTK_RESPONSE_DELETE_EVENT); + OnResponse(gtk_dialog_, GTK_RESPONSE_DELETE_EVENT); } void JSModalDialogGtk::AcceptAppModalDialog() { - OnDialogResponse(gtk_dialog_, GTK_RESPONSE_OK); + OnResponse(gtk_dialog_, GTK_RESPONSE_OK); } void JSModalDialogGtk::CancelAppModalDialog() { - OnDialogResponse(gtk_dialog_, GTK_RESPONSE_CANCEL); + OnResponse(gtk_dialog_, GTK_RESPONSE_CANCEL); } //////////////////////////////////////////////////////////////////////////////// // JSModalDialogGtk, private: -void JSModalDialogGtk::OnDialogResponse(GtkWidget* dialog, - int response_id) { +void JSModalDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { switch (response_id) { case GTK_RESPONSE_OK: // The first arg is the prompt text and the second is true if we want to @@ -205,7 +203,7 @@ void JSModalDialogGtk::OnDialogResponse(GtkWidget* dialog, default: NOTREACHED(); } - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_destroy(dialog); // Now that the dialog is gone, we can put all the windows into separate // window groups so other dialogs are no longer app modal. diff --git a/chrome/browser/ui/gtk/js_modal_dialog_gtk.h b/chrome/browser/ui/gtk/js_modal_dialog_gtk.h index 5626651..082731e 100644 --- a/chrome/browser/ui/gtk/js_modal_dialog_gtk.h +++ b/chrome/browser/ui/gtk/js_modal_dialog_gtk.h @@ -22,7 +22,7 @@ class JSModalDialogGtk : public NativeAppModalDialog { gfx::NativeWindow parent_window); virtual ~JSModalDialogGtk(); - // Overridden from NativeAppModalDialog: + // NativeAppModalDialog: virtual int GetAppModalDialogButtons() const; virtual void ShowAppModalDialog(); virtual void ActivateAppModalDialog(); @@ -31,7 +31,7 @@ class JSModalDialogGtk : public NativeAppModalDialog { virtual void CancelAppModalDialog(); private: - CHROMEGTK_CALLBACK_1(JSModalDialogGtk, void, OnDialogResponse, int); + CHROMEGTK_CALLBACK_1(JSModalDialogGtk, void, OnResponse, int); scoped_ptr<JavaScriptAppModalDialog> dialog_; GtkWidget* gtk_dialog_; diff --git a/chrome/browser/ui/gtk/keyword_editor_view.cc b/chrome/browser/ui/gtk/keyword_editor_view.cc index c0a5acd..f1777d2 100644 --- a/chrome/browser/ui/gtk/keyword_editor_view.cc +++ b/chrome/browser/ui/gtk/keyword_editor_view.cc @@ -197,7 +197,7 @@ void KeywordEditorView::Init() { EnableControls(); - g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); } @@ -396,10 +396,8 @@ void KeywordEditorView::OnWindowDestroy(GtkWidget* widget, MessageLoop::current()->DeleteSoon(FROM_HERE, window); } -// static -void KeywordEditorView::OnResponse(GtkDialog* dialog, int response_id, - KeywordEditorView* window) { - gtk_widget_destroy(window->dialog_); +void KeywordEditorView::OnResponse(GtkWidget* dialog, int response_id) { + gtk_widget_destroy(dialog_); } // static diff --git a/chrome/browser/ui/gtk/keyword_editor_view.h b/chrome/browser/ui/gtk/keyword_editor_view.h index 7a6a7bd..0bc68b5 100644 --- a/chrome/browser/ui/gtk/keyword_editor_view.h +++ b/chrome/browser/ui/gtk/keyword_editor_view.h @@ -14,6 +14,7 @@ #include "base/string16.h" #include "chrome/browser/search_engines/template_url_model_observer.h" #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" +#include "ui/base/gtk/gtk_signal.h" #include "ui/base/models/table_model_observer.h" class KeywordEditorController; @@ -89,8 +90,7 @@ class KeywordEditorView : public ui::TableModelObserver, static void OnWindowDestroy(GtkWidget* widget, KeywordEditorView* window); // Callback for dialog buttons. - static void OnResponse(GtkDialog* dialog, int response_id, - KeywordEditorView* window); + CHROMEGTK_CALLBACK_1(KeywordEditorView, void, OnResponse, int); // Callback checking whether a row should be drawn as a separator. static gboolean OnCheckRowIsSeparator(GtkTreeModel* model, diff --git a/chrome/browser/ui/gtk/options/content_exception_editor.cc b/chrome/browser/ui/gtk/options/content_exception_editor.cc index 1b5eadc..e31078c 100644 --- a/chrome/browser/ui/gtk/options/content_exception_editor.cc +++ b/chrome/browser/ui/gtk/options/content_exception_editor.cc @@ -116,7 +116,7 @@ void ContentExceptionEditor::OnEntryChanged(GtkWidget* entry) { UpdateImage(pattern_image_, is_valid); } -void ContentExceptionEditor::OnResponse(GtkWidget* sender, int response_id) { +void ContentExceptionEditor::OnResponse(GtkWidget* dialog, int response_id) { if (response_id == GTK_RESPONSE_OK) { // Notify our delegate to update everything. ContentSettingsPattern new_pattern(gtk_entry_get_text(GTK_ENTRY(entry_))); diff --git a/chrome/browser/ui/gtk/options/passwords_page_gtk.cc b/chrome/browser/ui/gtk/options/passwords_page_gtk.cc index 6a0a45a..c8d7d7c 100644 --- a/chrome/browser/ui/gtk/options/passwords_page_gtk.cc +++ b/chrome/browser/ui/gtk/options/passwords_page_gtk.cc @@ -244,17 +244,17 @@ void PasswordsPageGtk::OnRemoveAllButtonClicked(GtkWidget* widget) { gtk_widget_show_all(confirm); } -void PasswordsPageGtk::OnRemoveAllConfirmResponse(GtkWidget* confirm, - gint response) { +void PasswordsPageGtk::OnRemoveAllConfirmResponse(GtkWidget* dialog, + int response_id) { bool confirmed = false; - switch (response) { + switch (response_id) { case GTK_RESPONSE_YES: confirmed = true; break; default: break; } - gtk_widget_destroy(confirm); + gtk_widget_destroy(dialog); if (!confirmed) return; diff --git a/chrome/browser/ui/gtk/process_singleton_dialog.cc b/chrome/browser/ui/gtk/process_singleton_dialog.cc index 78d91cf..53f4db0 100644 --- a/chrome/browser/ui/gtk/process_singleton_dialog.cc +++ b/chrome/browser/ui/gtk/process_singleton_dialog.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/gtk/process_singleton_dialog.h" +#include <gtk/gtk.h> + #include "base/message_loop.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/chromium_strings.h" @@ -28,15 +30,13 @@ ProcessSingletonDialog::ProcessSingletonDialog(const std::string& message) { gtk_dialog_add_button(GTK_DIALOG(dialog_), GTK_STOCK_QUIT, GTK_RESPONSE_REJECT); - g_signal_connect(dialog_, "response", G_CALLBACK(OnResponse), this); + g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); gtk_widget_show_all(dialog_); MessageLoop::current()->Run(); } -// static -void ProcessSingletonDialog::OnResponse(GtkWidget* widget, int response, - ProcessSingletonDialog* dialog) { - gtk_widget_destroy(dialog->dialog_); +void ProcessSingletonDialog::OnResponse(GtkWidget* dialog, int response_id) { + gtk_widget_destroy(dialog_); MessageLoop::current()->Quit(); } diff --git a/chrome/browser/ui/gtk/process_singleton_dialog.h b/chrome/browser/ui/gtk/process_singleton_dialog.h index e46803e..76194c1 100644 --- a/chrome/browser/ui/gtk/process_singleton_dialog.h +++ b/chrome/browser/ui/gtk/process_singleton_dialog.h @@ -8,9 +8,10 @@ #include <string> -#include <gtk/gtk.h> - #include "base/basictypes.h" +#include "ui/base/gtk/gtk_signal.h" + +typedef struct _GtkWidget GtkWidget; // Displays an error to the user when the ProcessSingleton cannot acquire the // lock. This runs the message loop itself as the browser message loop has not @@ -23,9 +24,7 @@ class ProcessSingletonDialog { private: explicit ProcessSingletonDialog(const std::string& message); - static void OnResponse(GtkWidget* widget, - int response, - ProcessSingletonDialog* dialog); + CHROMEGTK_CALLBACK_1(ProcessSingletonDialog, void, OnResponse, int); GtkWidget* dialog_; diff --git a/chrome/browser/ui/gtk/task_manager_gtk.cc b/chrome/browser/ui/gtk/task_manager_gtk.cc index 2b9a13b..62a3a4e 100644 --- a/chrome/browser/ui/gtk/task_manager_gtk.cc +++ b/chrome/browser/ui/gtk/task_manager_gtk.cc @@ -857,7 +857,7 @@ void TaskManagerGtk::OnDestroy(GtkWidget* dialog) { delete this; } -void TaskManagerGtk::OnResponse(GtkWidget* dialog, gint response_id) { +void TaskManagerGtk::OnResponse(GtkWidget* dialog, int response_id) { if (response_id == GTK_RESPONSE_DELETE_EVENT) { // Store the dialog's size so we can restore it the next time it's opened. if (g_browser_process->local_state()) { diff --git a/chrome/browser/ui/gtk/task_manager_gtk.h b/chrome/browser/ui/gtk/task_manager_gtk.h index fc5c021..ff10b8e 100644 --- a/chrome/browser/ui/gtk/task_manager_gtk.h +++ b/chrome/browser/ui/gtk/task_manager_gtk.h @@ -82,7 +82,7 @@ class TaskManagerGtk : public TaskManagerModelObserver { CHROMEGTK_CALLBACK_0(TaskManagerGtk, void, OnDestroy); // Response signal handler that notifies us of dialog responses. - CHROMEGTK_CALLBACK_1(TaskManagerGtk, void, OnResponse, gint); + CHROMEGTK_CALLBACK_1(TaskManagerGtk, void, OnResponse, int); // Realize signal handler to set the page column's initial size. CHROMEG_CALLBACK_0(TaskManagerGtk, void, OnTreeViewRealize, GtkTreeView*); diff --git a/chrome/browser/ui/gtk/update_recommended_dialog.cc b/chrome/browser/ui/gtk/update_recommended_dialog.cc index d39736f..691430f 100644 --- a/chrome/browser/ui/gtk/update_recommended_dialog.cc +++ b/chrome/browser/ui/gtk/update_recommended_dialog.cc @@ -52,7 +52,7 @@ UpdateRecommendedDialog::UpdateRecommendedDialog(GtkWindow* parent) { UpdateRecommendedDialog::~UpdateRecommendedDialog() { } -void UpdateRecommendedDialog::OnResponse(GtkWidget* sender, gint response_id) { +void UpdateRecommendedDialog::OnResponse(GtkWidget* dialog, int response_id) { gtk_widget_destroy(dialog_); if (response_id == GTK_RESPONSE_ACCEPT) { diff --git a/chrome/browser/ui/gtk/update_recommended_dialog.h b/chrome/browser/ui/gtk/update_recommended_dialog.h index e52a505..8c4955a 100644 --- a/chrome/browser/ui/gtk/update_recommended_dialog.h +++ b/chrome/browser/ui/gtk/update_recommended_dialog.h @@ -18,11 +18,11 @@ class UpdateRecommendedDialog { static void Show(GtkWindow* parent); private: - CHROMEGTK_CALLBACK_1(UpdateRecommendedDialog, void, OnResponse, gint); - explicit UpdateRecommendedDialog(GtkWindow* parent); ~UpdateRecommendedDialog(); + CHROMEGTK_CALLBACK_1(UpdateRecommendedDialog, void, OnResponse, int); + GtkWidget* dialog_; DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedDialog); diff --git a/chrome/browser/ui/input_window_dialog_gtk.cc b/chrome/browser/ui/input_window_dialog_gtk.cc index 4b2c3f7..e432d29 100644 --- a/chrome/browser/ui/input_window_dialog_gtk.cc +++ b/chrome/browser/ui/input_window_dialog_gtk.cc @@ -98,7 +98,7 @@ void InputWindowDialogGtk::Close() { // Under the model that we've inherited from Windows, dialogs can receive // more than one Close() call inside the current message loop event. if (dialog_) { - gtk_widget_destroy(GTK_WIDGET(dialog_)); + gtk_widget_destroy(dialog_); dialog_ = NULL; } } |