Index: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
index 4d6e5e6a4de26be8a560a8684f5162f93d4a1c61..eb679bdbee4fe1b6d8e06050364729c5d9f6ebe5 100644 |
--- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
+++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
@@ -52,6 +52,14 @@ |
namespace { |
+// NOTE(jdonnelly): This use of this process-wide variable assumes that there's |
+// never more than one website settings popup shown and that it's associated |
+// with the current window. If this assumption fails in the future, we'll need |
+// to return a weak pointer from ShowPopup so callers can associate it with the |
+// current window (or other context) and check if the popup they care about is |
+// showing. |
+bool is_popup_showing = false; |
+ |
// Padding values for sections on the connection tab. |
const int kConnectionSectionPaddingBottom = 16; |
const int kConnectionSectionPaddingLeft = 18; |
@@ -140,6 +148,9 @@ class InternalPageInfoPopupView : public views::BubbleDelegateView { |
explicit InternalPageInfoPopupView(views::View* anchor_view); |
virtual ~InternalPageInfoPopupView(); |
+ // views::BubbleDelegateView: |
+ virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(InternalPageInfoPopupView); |
}; |
@@ -248,6 +259,10 @@ InternalPageInfoPopupView::InternalPageInfoPopupView(views::View* anchor_view) |
InternalPageInfoPopupView::~InternalPageInfoPopupView() { |
} |
+void InternalPageInfoPopupView::OnWidgetDestroying(views::Widget* widget) { |
+ is_popup_showing = false; |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// WebsiteSettingsPopupView |
//////////////////////////////////////////////////////////////////////////////// |
@@ -262,6 +277,7 @@ void WebsiteSettingsPopupView::ShowPopup(views::View* anchor_view, |
const GURL& url, |
const content::SSLStatus& ssl, |
Browser* browser) { |
+ is_popup_showing = true; |
if (InternalChromePage(url)) { |
new InternalPageInfoPopupView(anchor_view); |
} else { |
@@ -270,6 +286,11 @@ void WebsiteSettingsPopupView::ShowPopup(views::View* anchor_view, |
} |
} |
+// static |
+bool WebsiteSettingsPopupView::IsPopupShowing() { |
+ return is_popup_showing; |
+} |
+ |
WebsiteSettingsPopupView::WebsiteSettingsPopupView( |
views::View* anchor_view, |
Profile* profile, |
@@ -355,6 +376,7 @@ void WebsiteSettingsPopupView::OnPermissionChanged( |
} |
void WebsiteSettingsPopupView::OnWidgetDestroying(views::Widget* widget) { |
+ is_popup_showing = false; |
presenter_->OnUIClosing(); |
} |