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

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

Issue 6873082: Fix DELETE_EVENT handling in 3 places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 8 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/ui/gtk/hung_renderer_dialog_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/js_modal_dialog_gtk.cc
diff --git a/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc b/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc
index 74b8c0eb5b229f8e133b11754a64decd3166d4fa..d351cd68c36cb9feff8f2b49a37e33aa8b9b0b61 100644
--- a/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc
@@ -135,9 +135,18 @@ JSModalDialogGtk::JSModalDialogGtk(JavaScriptAppModalDialog* dialog,
gtk_dialog_set_default_response(GTK_DIALOG(gtk_dialog_), GTK_RESPONSE_OK);
g_signal_connect(gtk_dialog_, "response", G_CALLBACK(OnResponseThunk), this);
+ // NULL out |gtk_dialog_| when it's destroyed.
Elliot Glaysher 2011/04/19 19:40:13 Today I learn something about GTK.
+ g_signal_connect(gtk_dialog_, "destroy",
+ G_CALLBACK(gtk_widget_destroyed), &gtk_dialog_);
}
JSModalDialogGtk::~JSModalDialogGtk() {
+ if (gtk_dialog_)
+ gtk_widget_destroy(gtk_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.
+ gtk_util::AppModalDismissedUngroupWindows();
}
////////////////////////////////////////////////////////////////////////////////
@@ -168,7 +177,8 @@ void JSModalDialogGtk::ShowAppModalDialog() {
void JSModalDialogGtk::ActivateAppModalDialog() {
DCHECK(gtk_dialog_);
- gtk_window_present(GTK_WINDOW(gtk_dialog_));}
+ gtk_window_present(GTK_WINDOW(gtk_dialog_));
+}
void JSModalDialogGtk::CloseAppModalDialog() {
DCHECK(gtk_dialog_);
@@ -203,11 +213,7 @@ void JSModalDialogGtk::OnResponse(GtkWidget* dialog, int response_id) {
default:
NOTREACHED();
}
- 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.
- gtk_util::AppModalDismissedUngroupWindows();
delete this;
}
« no previous file with comments | « chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698