| 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,
|
|
|