| Index: chrome/browser/ui/views/page_info/page_info_popup_view.cc
|
| diff --git a/chrome/browser/ui/views/page_info/page_info_popup_view.cc b/chrome/browser/ui/views/page_info/page_info_popup_view.cc
|
| index c1b73ff459d28444d0364d5c46c54b595f4e59cf..097555b34a83c44a8acc5dbae936cb907dc366fe 100644
|
| --- a/chrome/browser/ui/views/page_info/page_info_popup_view.cc
|
| +++ b/chrome/browser/ui/views/page_info/page_info_popup_view.cc
|
| @@ -68,7 +68,8 @@ namespace {
|
| // 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.
|
| -PageInfoPopupView::PopupType g_shown_popup_type = PageInfoPopupView::POPUP_NONE;
|
| +PageInfoBubbleView::PopupType g_shown_popup_type =
|
| + PageInfoBubbleView::POPUP_NONE;
|
|
|
| // General constants -----------------------------------------------------------
|
|
|
| @@ -123,7 +124,7 @@ void AddColumnWithSideMargin(views::GridLayout* layout, int margin, int id) {
|
| } // namespace
|
|
|
| // |PopupHeaderView| is the UI element (view) that represents the header of the
|
| -// |PageInfoPopupView|. The header shows the status of the site's
|
| +// |PageInfoBubbleView|. The header shows the status of the site's
|
| // identity check and the name of the site's identity.
|
| class PopupHeaderView : public views::View {
|
| public:
|
| @@ -158,29 +159,29 @@ class PopupHeaderView : public views::View {
|
| DISALLOW_COPY_AND_ASSIGN(PopupHeaderView);
|
| };
|
|
|
| -// The regular PageInfoPopupView is not supported for internal Chrome pages and
|
| -// extension pages. Instead of the |PageInfoPopupView|, the
|
| -// |InternalPageInfoPopupView| is displayed.
|
| -class InternalPageInfoPopupView : public views::BubbleDialogDelegateView {
|
| +// The regular PageInfoBubbleView is not supported for internal Chrome pages and
|
| +// extension pages. Instead of the |PageInfoBubbleView|, the
|
| +// |InternalPageInfoBubbleView| is displayed.
|
| +class InternalPageInfoBubbleView : public views::BubbleDialogDelegateView {
|
| public:
|
| // If |anchor_view| is nullptr, or has no Widget, |parent_window| may be
|
| // provided to ensure this bubble is closed when the parent closes.
|
| - InternalPageInfoPopupView(views::View* anchor_view,
|
| - gfx::NativeView parent_window,
|
| - const GURL& url);
|
| - ~InternalPageInfoPopupView() override;
|
| + InternalPageInfoBubbleView(views::View* anchor_view,
|
| + gfx::NativeView parent_window,
|
| + const GURL& url);
|
| + ~InternalPageInfoBubbleView() override;
|
|
|
| // views::BubbleDialogDelegateView:
|
| void OnWidgetDestroying(views::Widget* widget) override;
|
| int GetDialogButtons() const override;
|
|
|
| private:
|
| - friend class PageInfoPopupView;
|
| + friend class PageInfoBubbleView;
|
|
|
| // Used around icon and inside bubble border.
|
| static constexpr int kSpacing = 12;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(InternalPageInfoPopupView);
|
| + DISALLOW_COPY_AND_ASSIGN(InternalPageInfoBubbleView);
|
| };
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| @@ -276,15 +277,15 @@ void PopupHeaderView::AddResetDecisionsLabel() {
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// InternalPageInfoPopupView
|
| +// InternalPageInfoBubbleView
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| -InternalPageInfoPopupView::InternalPageInfoPopupView(
|
| +InternalPageInfoBubbleView::InternalPageInfoBubbleView(
|
| views::View* anchor_view,
|
| gfx::NativeView parent_window,
|
| const GURL& url)
|
| : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT) {
|
| - g_shown_popup_type = PageInfoPopupView::POPUP_INTERNAL_PAGE;
|
| + g_shown_popup_type = PageInfoBubbleView::POPUP_INTERNAL_PAGE;
|
| set_parent_window(parent_window);
|
|
|
| int text = IDS_PAGE_INFO_INTERNAL_PAGE;
|
| @@ -324,24 +325,24 @@ InternalPageInfoPopupView::InternalPageInfoPopupView(
|
| views::BubbleDialogDelegateView::CreateBubble(this);
|
| }
|
|
|
| -InternalPageInfoPopupView::~InternalPageInfoPopupView() {}
|
| +InternalPageInfoBubbleView::~InternalPageInfoBubbleView() {}
|
|
|
| -void InternalPageInfoPopupView::OnWidgetDestroying(views::Widget* widget) {
|
| - g_shown_popup_type = PageInfoPopupView::POPUP_NONE;
|
| +void InternalPageInfoBubbleView::OnWidgetDestroying(views::Widget* widget) {
|
| + g_shown_popup_type = PageInfoBubbleView::POPUP_NONE;
|
| }
|
|
|
| -int InternalPageInfoPopupView::GetDialogButtons() const {
|
| +int InternalPageInfoBubbleView::GetDialogButtons() const {
|
| return ui::DIALOG_BUTTON_NONE;
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// PageInfoPopupView
|
| +// PageInfoBubbleView
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|
| -PageInfoPopupView::~PageInfoPopupView() {}
|
| +PageInfoBubbleView::~PageInfoBubbleView() {}
|
|
|
| // static
|
| -void PageInfoPopupView::ShowPopup(
|
| +void PageInfoBubbleView::ShowPopup(
|
| views::View* anchor_view,
|
| const gfx::Rect& anchor_rect,
|
| Profile* profile,
|
| @@ -355,14 +356,14 @@ void PageInfoPopupView::ShowPopup(
|
| url.SchemeIs(extensions::kExtensionScheme) ||
|
| url.SchemeIs(content::kViewSourceScheme)) {
|
| // Use the concrete type so that |SetAnchorRect| can be called as a friend.
|
| - InternalPageInfoPopupView* popup =
|
| - new InternalPageInfoPopupView(anchor_view, parent_window, url);
|
| + InternalPageInfoBubbleView* popup =
|
| + new InternalPageInfoBubbleView(anchor_view, parent_window, url);
|
| if (!anchor_view)
|
| popup->SetAnchorRect(anchor_rect);
|
| popup->GetWidget()->Show();
|
| return;
|
| }
|
| - PageInfoPopupView* popup = new PageInfoPopupView(
|
| + PageInfoBubbleView* popup = new PageInfoBubbleView(
|
| anchor_view, parent_window, profile, web_contents, url, security_info);
|
| if (!anchor_view)
|
| popup->SetAnchorRect(anchor_rect);
|
| @@ -370,11 +371,11 @@ void PageInfoPopupView::ShowPopup(
|
| }
|
|
|
| // static
|
| -PageInfoPopupView::PopupType PageInfoPopupView::GetShownPopupType() {
|
| +PageInfoBubbleView::PopupType PageInfoBubbleView::GetShownPopupType() {
|
| return g_shown_popup_type;
|
| }
|
|
|
| -PageInfoPopupView::PageInfoPopupView(
|
| +PageInfoBubbleView::PageInfoBubbleView(
|
| views::View* anchor_view,
|
| gfx::NativeView parent_window,
|
| Profile* profile,
|
| @@ -447,17 +448,17 @@ PageInfoPopupView::PageInfoPopupView(
|
| web_contents, url, security_info));
|
| }
|
|
|
| -void PageInfoPopupView::RenderFrameDeleted(
|
| +void PageInfoBubbleView::RenderFrameDeleted(
|
| content::RenderFrameHost* render_frame_host) {
|
| if (render_frame_host == web_contents()->GetMainFrame())
|
| GetWidget()->Close();
|
| }
|
|
|
| -void PageInfoPopupView::WebContentsDestroyed() {
|
| +void PageInfoBubbleView::WebContentsDestroyed() {
|
| weak_factory_.InvalidateWeakPtrs();
|
| }
|
|
|
| -void PageInfoPopupView::OnPermissionChanged(
|
| +void PageInfoBubbleView::OnPermissionChanged(
|
| const PageInfoUI::PermissionInfo& permission) {
|
| presenter_->OnSitePermissionChanged(permission.type, permission.setting);
|
| // The menu buttons for the permissions might have longer strings now, so we
|
| @@ -466,50 +467,50 @@ void PageInfoPopupView::OnPermissionChanged(
|
| SizeToContents();
|
| }
|
|
|
| -void PageInfoPopupView::OnChosenObjectDeleted(
|
| +void PageInfoBubbleView::OnChosenObjectDeleted(
|
| const PageInfoUI::ChosenObjectInfo& info) {
|
| presenter_->OnSiteChosenObjectDeleted(info.ui_info, *info.object);
|
| }
|
|
|
| -base::string16 PageInfoPopupView::GetWindowTitle() const {
|
| +base::string16 PageInfoBubbleView::GetWindowTitle() const {
|
| return summary_text_;
|
| }
|
|
|
| -bool PageInfoPopupView::ShouldShowCloseButton() const {
|
| +bool PageInfoBubbleView::ShouldShowCloseButton() const {
|
| return true;
|
| }
|
|
|
| -void PageInfoPopupView::OnWidgetDestroying(views::Widget* widget) {
|
| +void PageInfoBubbleView::OnWidgetDestroying(views::Widget* widget) {
|
| g_shown_popup_type = POPUP_NONE;
|
| presenter_->OnUIClosing();
|
| }
|
|
|
| -int PageInfoPopupView::GetDialogButtons() const {
|
| +int PageInfoBubbleView::GetDialogButtons() const {
|
| return ui::DIALOG_BUTTON_NONE;
|
| }
|
|
|
| -const gfx::FontList& PageInfoPopupView::GetTitleFontList() const {
|
| +const gfx::FontList& PageInfoBubbleView::GetTitleFontList() const {
|
| return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
|
| kSummaryFontSizeDelta);
|
| }
|
|
|
| -void PageInfoPopupView::ButtonPressed(views::Button* button,
|
| - const ui::Event& event) {
|
| +void PageInfoBubbleView::ButtonPressed(views::Button* button,
|
| + const ui::Event& event) {
|
| DCHECK_EQ(BUTTON_CLOSE, button->id());
|
| GetWidget()->Close();
|
| }
|
|
|
| -void PageInfoPopupView::LinkClicked(views::Link* source, int event_flags) {
|
| +void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) {
|
| // The popup closes automatically when the collected cookies dialog or the
|
| // certificate viewer opens. So delay handling of the link clicked to avoid
|
| // a crash in the base class which needs to complete the mouse event handling.
|
| content::BrowserThread::PostTask(
|
| content::BrowserThread::UI, FROM_HERE,
|
| - base::Bind(&PageInfoPopupView::HandleLinkClickedAsync,
|
| + base::Bind(&PageInfoBubbleView::HandleLinkClickedAsync,
|
| weak_factory_.GetWeakPtr(), source));
|
| }
|
|
|
| -gfx::Size PageInfoPopupView::GetPreferredSize() const {
|
| +gfx::Size PageInfoBubbleView::GetPreferredSize() const {
|
| if (header_ == nullptr && site_settings_view_ == nullptr)
|
| return views::View::GetPreferredSize();
|
|
|
| @@ -529,7 +530,7 @@ gfx::Size PageInfoPopupView::GetPreferredSize() const {
|
| return gfx::Size(width, height);
|
| }
|
|
|
| -void PageInfoPopupView::SetCookieInfo(const CookieInfoList& cookie_info_list) {
|
| +void PageInfoBubbleView::SetCookieInfo(const CookieInfoList& cookie_info_list) {
|
| // |cookie_info_list| should only ever have 2 items: first- and third-party
|
| // cookies.
|
| DCHECK_EQ(cookie_info_list.size(), 2u);
|
| @@ -596,7 +597,7 @@ void PageInfoPopupView::SetCookieInfo(const CookieInfoList& cookie_info_list) {
|
| SizeToContents();
|
| }
|
|
|
| -void PageInfoPopupView::SetPermissionInfo(
|
| +void PageInfoBubbleView::SetPermissionInfo(
|
| const PermissionInfoList& permission_info_list,
|
| ChosenObjectInfoList chosen_object_info_list) {
|
| // When a permission is changed, PageInfo::OnSitePermissionChanged()
|
| @@ -669,7 +670,7 @@ void PageInfoPopupView::SetPermissionInfo(
|
| SizeToContents();
|
| }
|
|
|
| -void PageInfoPopupView::SetIdentityInfo(const IdentityInfo& identity_info) {
|
| +void PageInfoBubbleView::SetIdentityInfo(const IdentityInfo& identity_info) {
|
| std::unique_ptr<PageInfoUI::SecurityDescription> security_description =
|
| identity_info.GetSecurityDescription();
|
|
|
| @@ -689,7 +690,7 @@ void PageInfoPopupView::SetIdentityInfo(const IdentityInfo& identity_info) {
|
| SizeToContents();
|
| }
|
|
|
| -views::View* PageInfoPopupView::CreateSiteSettingsView(int side_margin) {
|
| +views::View* PageInfoBubbleView::CreateSiteSettingsView(int side_margin) {
|
| views::View* site_settings_view = new views::View();
|
| views::BoxLayout* box_layout =
|
| new views::BoxLayout(views::BoxLayout::kVertical, side_margin, 0, 0);
|
| @@ -704,7 +705,7 @@ views::View* PageInfoPopupView::CreateSiteSettingsView(int side_margin) {
|
| return site_settings_view;
|
| }
|
|
|
| -void PageInfoPopupView::HandleLinkClickedAsync(views::Link* source) {
|
| +void PageInfoBubbleView::HandleLinkClickedAsync(views::Link* source) {
|
| // Both switch cases require accessing web_contents(), so we check it here.
|
| if (web_contents() == nullptr || web_contents()->IsBeingDestroyed())
|
| return;
|
| @@ -732,9 +733,9 @@ void PageInfoPopupView::HandleLinkClickedAsync(views::Link* source) {
|
| }
|
| }
|
|
|
| -void PageInfoPopupView::StyledLabelLinkClicked(views::StyledLabel* label,
|
| - const gfx::Range& range,
|
| - int event_flags) {
|
| +void PageInfoBubbleView::StyledLabelLinkClicked(views::StyledLabel* label,
|
| + const gfx::Range& range,
|
| + int event_flags) {
|
| switch (label->id()) {
|
| case STYLED_LABEL_SECURITY_DETAILS:
|
| web_contents()->OpenURL(content::OpenURLParams(
|
|
|