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

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

Issue 1280673003: [Mac] Enable MacViews site settings bubble behind --enable-mac-views-dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enabledialogs
Patch Set: Nits. Created 5 years, 4 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/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 54229954826b7a0420da6b852ea3c14a066b8097..5c08cba80645b9d5c84a9a39a62215cfa7cbf6bf 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
@@ -148,6 +148,8 @@ class InternalPageInfoPopupView : public views::BubbleDelegateView {
void OnWidgetDestroying(views::Widget* widget) override;
private:
+ friend class WebsiteSettingsPopupView;
+
DISALLOW_COPY_AND_ASSIGN(InternalPageInfoPopupView);
};
@@ -250,8 +252,7 @@ InternalPageInfoPopupView::InternalPageInfoPopupView(views::View* anchor_view)
label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(label);
- views::BubbleDelegateView::CreateBubble(this)->Show();
- SizeToContents();
+ views::BubbleDelegateView::CreateBubble(this);
}
InternalPageInfoPopupView::~InternalPageInfoPopupView() {
@@ -275,11 +276,36 @@ void WebsiteSettingsPopupView::ShowPopup(views::View* anchor_view,
const GURL& url,
const content::SSLStatus& ssl) {
is_popup_showing = true;
+ views::BubbleDelegateView* popup = nullptr;
if (InternalChromePage(url)) {
- new InternalPageInfoPopupView(anchor_view);
+ popup = new InternalPageInfoPopupView(anchor_view);
} else {
- new WebsiteSettingsPopupView(anchor_view, profile, web_contents, url, ssl);
+ popup = new WebsiteSettingsPopupView(anchor_view, profile, web_contents,
+ url, ssl);
}
+ popup->GetWidget()->Show();
+}
+
+// static
+views::BubbleDelegateView* WebsiteSettingsPopupView::ShowPopupAtRect(
+ const gfx::Rect& anchor_rect,
+ Profile* profile,
+ content::WebContents* web_contents,
+ const GURL& url,
+ const content::SSLStatus& ssl) {
+ is_popup_showing = true;
+ if (InternalChromePage(url)) {
+ InternalPageInfoPopupView* popup = new InternalPageInfoPopupView(nullptr);
+ popup->SetAnchorRect(anchor_rect);
+ popup->GetWidget()->Show();
+ return popup;
+ }
+
+ WebsiteSettingsPopupView* popup =
+ new WebsiteSettingsPopupView(nullptr, profile, web_contents, url, ssl);
+ popup->SetAnchorRect(anchor_rect);
+ popup->GetWidget()->Show();
+ return popup;
}
// static
@@ -354,8 +380,7 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView(
set_margins(gfx::Insets(kPopupMarginTop, kPopupMarginLeft,
kPopupMarginBottom, kPopupMarginRight));
- views::BubbleDelegateView::CreateBubble(this)->Show();
- SizeToContents();
+ views::BubbleDelegateView::CreateBubble(this);
presenter_.reset(new WebsiteSettings(
this, profile,

Powered by Google App Engine
This is Rietveld 408576698