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

Unified Diff: chrome/browser/gtk/js_modal_dialog_gtk.cc

Issue 5999008: gtk: Cleanup JSModalDialogGtk implementation. (Closed)
Patch Set: Created 10 years 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/js_modal_dialog_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/js_modal_dialog_gtk.cc
diff --git a/chrome/browser/gtk/js_modal_dialog_gtk.cc b/chrome/browser/gtk/js_modal_dialog_gtk.cc
index cae6b63696cf3a19df5110fc787190e9c38c3506..27888d40a1a5793d066ade895a0a7ac2ec48a4c5 100644
--- a/chrome/browser/gtk/js_modal_dialog_gtk.cc
+++ b/chrome/browser/gtk/js_modal_dialog_gtk.cc
@@ -135,8 +135,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(JSModalDialogGtk::OnDialogResponse),
- reinterpret_cast<JSModalDialogGtk*>(this));
+ G_CALLBACK(OnDialogResponseThunk), this);
}
JSModalDialogGtk::~JSModalDialogGtk() {
@@ -174,32 +173,33 @@ void JSModalDialogGtk::ActivateAppModalDialog() {
void JSModalDialogGtk::CloseAppModalDialog() {
DCHECK(gtk_dialog_);
- HandleDialogResponse(GTK_DIALOG(gtk_dialog_), GTK_RESPONSE_DELETE_EVENT);
+ OnDialogResponse(gtk_dialog_, GTK_RESPONSE_DELETE_EVENT);
}
void JSModalDialogGtk::AcceptAppModalDialog() {
- HandleDialogResponse(GTK_DIALOG(gtk_dialog_), GTK_RESPONSE_OK);
+ OnDialogResponse(gtk_dialog_, GTK_RESPONSE_OK);
}
void JSModalDialogGtk::CancelAppModalDialog() {
- HandleDialogResponse(GTK_DIALOG(gtk_dialog_), GTK_RESPONSE_CANCEL);
+ OnDialogResponse(gtk_dialog_, GTK_RESPONSE_CANCEL);
}
////////////////////////////////////////////////////////////////////////////////
// JSModalDialogGtk, private:
-void JSModalDialogGtk::HandleDialogResponse(GtkDialog* dialog,
- gint response_id) {
+void JSModalDialogGtk::OnDialogResponse(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
// suppress additional popups from the page.
- dialog_->OnAccept(GetPromptText(dialog), ShouldSuppressJSDialogs(dialog));
+ dialog_->OnAccept(GetPromptText(GTK_DIALOG(dialog)),
+ ShouldSuppressJSDialogs(GTK_DIALOG(dialog)));
break;
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT: // User hit the X on the dialog.
- dialog_->OnCancel(ShouldSuppressJSDialogs(dialog));
+ dialog_->OnCancel(ShouldSuppressJSDialogs(GTK_DIALOG(dialog)));
break;
default:
@@ -213,13 +213,6 @@ void JSModalDialogGtk::HandleDialogResponse(GtkDialog* dialog,
delete this;
}
-// static
-void JSModalDialogGtk::OnDialogResponse(GtkDialog* gtk_dialog,
- gint response_id,
- JSModalDialogGtk* dialog) {
- dialog->HandleDialogResponse(gtk_dialog, response_id);
-}
-
////////////////////////////////////////////////////////////////////////////////
// NativeAppModalDialog, public:
@@ -229,5 +222,3 @@ NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt(
gfx::NativeWindow parent_window) {
return new JSModalDialogGtk(dialog, parent_window);
}
-
-
« no previous file with comments | « chrome/browser/gtk/js_modal_dialog_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698