From 75ab8a0ef23b8fcdd7a0c2ff35ad4622b2e14f1d Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Wed, 10 Feb 2010 01:06:07 +0000 Subject: GTK: fix DCHECK triggered when multiple ExtensionPopupGtks existed concurrently. BUG=35211 TEST=see bug Review URL: http://codereview.chromium.org/601014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38560 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/extension_popup_gtk.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'chrome/browser/gtk') diff --git a/chrome/browser/gtk/extension_popup_gtk.cc b/chrome/browser/gtk/extension_popup_gtk.cc index 75fab2df..2d25d96 100644 --- a/chrome/browser/gtk/extension_popup_gtk.cc +++ b/chrome/browser/gtk/extension_popup_gtk.cc @@ -25,7 +25,6 @@ ExtensionPopupGtk::ExtensionPopupGtk(Browser* browser, bubble_(NULL), host_(host), relative_to_(relative_to) { - // If the host had somehow finished loading, then we'd miss the notification // and not show. This seems to happen in single-process mode. if (host->did_stop_loading()) { @@ -63,8 +62,12 @@ void ExtensionPopupGtk::ShowPopup() { return; } - // Only one instance should be showing at a time. - DCHECK(!current_extension_popup_); + // Only one instance should be showing at a time. Get rid of the old one, if + // any. Typically, |current_extension_popup_| will be NULL, but it can be + // non-NULL if a browser action button is clicked while another extension + // popup's extension host is still loading. + if (current_extension_popup_) + current_extension_popup_->DestroyPopup(); current_extension_popup_ = this; // We'll be in the upper-right corner of the window for LTR languages, so we -- cgit v1.1