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

Unified Diff: chrome/browser/tab_contents/infobar.cc

Issue 7282036: Fix crash when clicking the close button on a closing infobar. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/infobar.cc
===================================================================
--- chrome/browser/tab_contents/infobar.cc (revision 91189)
+++ chrome/browser/tab_contents/infobar.cc (working copy)
@@ -101,7 +101,12 @@
}
void InfoBar::RemoveInfoBar() {
- if (!delegate_)
+ // If the user clicks the close button when the infobar is already closing
+ // (e.g. because this is the second click of a double-click on the button),
+ // |owner_| can be NULL here, in which case we don't want to call
+ // InfoBarDismissed() either (since this can lead to us double-recording
+ // dismissals).
+ if (!delegate_ || !owner_)
return;
delegate_->InfoBarDismissed();
owner_->RemoveInfoBar(delegate_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698