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

Unified Diff: chrome/browser/ui/gtk/infobars/confirm_infobar_gtk.cc

Issue 7981045: Make infobars ignore button clicks when closing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 3 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
Index: chrome/browser/ui/gtk/infobars/confirm_infobar_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/infobars/confirm_infobar_gtk.cc (revision 102206)
+++ chrome/browser/ui/gtk/infobars/confirm_infobar_gtk.cc (working copy)
@@ -82,16 +82,22 @@
}
void ConfirmInfoBarGtk::OnOkButton(GtkWidget* widget) {
+ if (!owned())
+ return; // We're closing; don't call anything, it might access the owner.
if (delegate()->AsConfirmInfoBarDelegate()->Accept())
RemoveSelf();
}
void ConfirmInfoBarGtk::OnCancelButton(GtkWidget* widget) {
+ if (!owned())
+ return; // We're closing; don't call anything, it might access the owner.
if (delegate()->AsConfirmInfoBarDelegate()->Cancel())
RemoveSelf();
}
void ConfirmInfoBarGtk::OnLinkClicked(GtkWidget* widget) {
+ if (!owned())
+ return; // We're closing; don't call anything, it might access the owner.
if (delegate()->AsConfirmInfoBarDelegate()->LinkClicked(
gtk_util::DispositionForCurrentButtonPressEvent()))
RemoveSelf();

Powered by Google App Engine
This is Rietveld 408576698