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

Unified Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 197623002: [OriginChip] Show the page info bubble on the location bar icon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a post-merge inconsistency Created 6 years, 9 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/views/website_settings/website_settings_popup_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/ui/views/website_settings/website_settings_popup_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698