Commit 026e9c4a authored by lgarron's avatar lgarron Committed by Commit bot

Rename PageInfoPopupView to PageInfoBubbleView.

Also renames PageInfoPopupViewBrowserTest to PageInfoBubbleViewBrowserTest.

BUG=708379

Review-Url: https://codereview.chromium.org/2797923003
Cr-Commit-Position: refs/heads/master@{#462977}
parent fff0252f
...@@ -1518,8 +1518,8 @@ split_static_library("ui") { ...@@ -1518,8 +1518,8 @@ split_static_library("ui") {
"views/page_info/chosen_object_row_observer.h", "views/page_info/chosen_object_row_observer.h",
"views/page_info/non_accessible_image_view.cc", "views/page_info/non_accessible_image_view.cc",
"views/page_info/non_accessible_image_view.h", "views/page_info/non_accessible_image_view.h",
"views/page_info/page_info_popup_view.cc", "views/page_info/page_info_bubble_view.cc",
"views/page_info/page_info_popup_view.h", "views/page_info/page_info_bubble_view.h",
"views/page_info/permission_selector_row.cc", "views/page_info/permission_selector_row.cc",
"views/page_info/permission_selector_row.h", "views/page_info/permission_selector_row.h",
"views/page_info/permission_selector_row_observer.h", "views/page_info/permission_selector_row_observer.h",
......
...@@ -115,9 +115,9 @@ const CGFloat kInternalPageImageSpacing = 10; ...@@ -115,9 +115,9 @@ const CGFloat kInternalPageImageSpacing = 10;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// NOTE: This assumes that there will never be more than one page info // NOTE: This assumes that there will never be more than one page info
// popup shown, and that the one that is shown is associated with the current // bubble shown, and that the one that is shown is associated with the current
// window. This matches the behaviour in views: see PageInfoPopupView. // window. This matches the behaviour in Views: see PageInfoBubbleView.
bool g_is_popup_showing = false; bool g_is_bubble_showing = false;
// Takes in the parent window, which should be a BrowserWindow, and gets the // Takes in the parent window, which should be a BrowserWindow, and gets the
// proper anchor point for the bubble. The returned point is in screen // proper anchor point for the bubble. The returned point is in screen
...@@ -1145,13 +1145,13 @@ PageInfoUIBridge::PageInfoUIBridge(content::WebContents* web_contents) ...@@ -1145,13 +1145,13 @@ PageInfoUIBridge::PageInfoUIBridge(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents), : content::WebContentsObserver(web_contents),
web_contents_(web_contents), web_contents_(web_contents),
bubble_controller_(nil) { bubble_controller_(nil) {
DCHECK(!g_is_popup_showing); DCHECK(!g_is_bubble_showing);
g_is_popup_showing = true; g_is_bubble_showing = true;
} }
PageInfoUIBridge::~PageInfoUIBridge() { PageInfoUIBridge::~PageInfoUIBridge() {
DCHECK(g_is_popup_showing); DCHECK(g_is_bubble_showing);
g_is_popup_showing = false; g_is_bubble_showing = false;
} }
void PageInfoUIBridge::set_bubble_controller( void PageInfoUIBridge::set_bubble_controller(
...@@ -1171,17 +1171,17 @@ void PageInfoUIBridge::Show(gfx::NativeWindow parent, ...@@ -1171,17 +1171,17 @@ void PageInfoUIBridge::Show(gfx::NativeWindow parent,
return; return;
} }
// Don't show the popup if it's already being shown. Since this method is // Don't show the bubble if it's already being shown. Since this method is
// called each time the location icon is clicked, each click toggles the popup // called each time the location icon is clicked, each click toggles the
// in and out. // bubble in and out.
if (g_is_popup_showing) if (g_is_bubble_showing)
return; return;
// Create the bridge. This will be owned by the bubble controller. // Create the bridge. This will be owned by the bubble controller.
PageInfoUIBridge* bridge = new PageInfoUIBridge(web_contents); PageInfoUIBridge* bridge = new PageInfoUIBridge(web_contents);
// Create the bubble controller. It will dealloc itself when it closes, // Create the bubble controller. It will dealloc itself when it closes,
// resetting |g_is_popup_showing|. // resetting |g_is_bubble_showing|.
PageInfoBubbleController* bubble_controller = PageInfoBubbleController* bubble_controller =
[[PageInfoBubbleController alloc] initWithParentWindow:parent [[PageInfoBubbleController alloc] initWithParentWindow:parent
pageInfoUIBridge:bridge pageInfoUIBridge:bridge
......
...@@ -337,7 +337,7 @@ void PageInfo::OnSitePermissionChanged(ContentSettingsType type, ...@@ -337,7 +337,7 @@ void PageInfo::OnSitePermissionChanged(ContentSettingsType type,
// This is technically redundant given the histogram above, but putting the // This is technically redundant given the histogram above, but putting the
// total count of permission changes in another histogram makes it easier to // total count of permission changes in another histogram makes it easier to
// compare it against other kinds of actions in PageInfo[PopupView]. // compare it against other kinds of actions in Page Info.
RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION); RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION);
PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter( PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter(
...@@ -407,7 +407,7 @@ void PageInfo::Init(const GURL& url, ...@@ -407,7 +407,7 @@ void PageInfo::Init(const GURL& url,
const security_state::SecurityInfo& security_info) { const security_state::SecurityInfo& security_info) {
#if !defined(OS_ANDROID) && !defined(OS_IOS) #if !defined(OS_ANDROID) && !defined(OS_IOS)
// On desktop, internal URLs aren't handled by this class. Instead, a // On desktop, internal URLs aren't handled by this class. Instead, a
// custom and simpler popup is shown. // custom and simpler bubble is shown.
DCHECK(!url.SchemeIs(content::kChromeUIScheme) && DCHECK(!url.SchemeIs(content::kChromeUIScheme) &&
!url.SchemeIs(content::kChromeDevToolsScheme) && !url.SchemeIs(content::kChromeDevToolsScheme) &&
!url.SchemeIs(content::kViewSourceScheme) && !url.SchemeIs(content::kViewSourceScheme) &&
......
...@@ -677,7 +677,7 @@ TEST_F(PageInfoTest, AboutBlankPage) { ...@@ -677,7 +677,7 @@ TEST_F(PageInfoTest, AboutBlankPage) {
} }
// On desktop, internal URLs aren't handled by PageInfo class. Instead, a // On desktop, internal URLs aren't handled by PageInfo class. Instead, a
// custom and simpler popup is shown, so no need to test. // custom and simpler bubble is shown, so no need to test.
#if defined(OS_ANDROID) || defined(OS_IOS) #if defined(OS_ANDROID) || defined(OS_IOS)
TEST_F(PageInfoTest, InternalPage) { TEST_F(PageInfoTest, InternalPage) {
SetURL("chrome://bookmarks"); SetURL("chrome://bookmarks");
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
#include "chrome/browser/ui/views/content_setting_bubble_contents.h" #include "chrome/browser/ui/views/content_setting_bubble_contents.h"
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/browser/ui/views/task_manager_view.h" #include "chrome/browser/ui/views/task_manager_view.h"
#include "chrome/browser/ui/views/update_recommended_message_box.h" #include "chrome/browser/ui/views/update_recommended_message_box.h"
...@@ -30,15 +30,16 @@ void ShowPageInfoBubbleViewsAtPoint( ...@@ -30,15 +30,16 @@ void ShowPageInfoBubbleViewsAtPoint(
// Don't show the bubble again if it's already showing. A second click on the // Don't show the bubble again if it's already showing. A second click on the
// location icon in the omnibox will dismiss an open bubble. This behaviour is // location icon in the omnibox will dismiss an open bubble. This behaviour is
// consistent with the non-Mac views implementation. // consistent with the non-Mac views implementation.
// Note that when the browser is toolkit-views, IsPopupShowing() is checked // Note that when the browser is toolkit-views, IsBubbleShowing() is checked
// earlier because the popup is shown on mouse release (but dismissed on // earlier because the bubble is shown on mouse release (but dismissed on
// mouse pressed). A Cocoa browser does both on mouse pressed, so a check // mouse pressed). A Cocoa browser does both on mouse pressed, so a check
// when showing is sufficient. // when showing is sufficient.
if (PageInfoPopupView::GetShownPopupType() != PageInfoPopupView::POPUP_NONE) { if (PageInfoBubbleView::GetShownBubbleType() !=
PageInfoBubbleView::BUBBLE_NONE) {
return; return;
} }
PageInfoPopupView::ShowPopup(nullptr, gfx::Rect(anchor_point, gfx::Size()), PageInfoBubbleView::ShowBubble(nullptr, gfx::Rect(anchor_point, gfx::Size()),
profile, web_contents, virtual_url, profile, web_contents, virtual_url,
security_info); security_info);
} }
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
#include "chrome/browser/ui/views/new_back_shortcut_bubble.h" #include "chrome/browser/ui/views/new_back_shortcut_bubble.h"
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h"
#include "chrome/browser/ui/views/status_bubble_views.h" #include "chrome/browser/ui/views/status_bubble_views.h"
#include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
...@@ -1295,7 +1295,7 @@ void BrowserView::ShowPageInfo( ...@@ -1295,7 +1295,7 @@ void BrowserView::ShowPageInfo(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& virtual_url, const GURL& virtual_url,
const security_state::SecurityInfo& security_info) { const security_state::SecurityInfo& security_info) {
PageInfoPopupView::ShowPopup( PageInfoBubbleView::ShowBubble(
GetLocationBarView()->GetSecurityBubbleAnchorView(), gfx::Rect(), profile, GetLocationBarView()->GetSecurityBubbleAnchorView(), gfx::Rect(), profile,
web_contents, virtual_url, security_info); web_contents, virtual_url, security_info);
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h" #include "chrome/grit/theme_resources.h"
#include "components/grit/components_scaled_resources.h" #include "components/grit/components_scaled_resources.h"
...@@ -54,8 +54,8 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { ...@@ -54,8 +54,8 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) {
model->PasteAndGo(text); model->PasteAndGo(text);
} }
suppress_mouse_released_action_ = suppress_mouse_released_action_ = PageInfoBubbleView::GetShownBubbleType() !=
PageInfoPopupView::GetShownPopupType() != PageInfoPopupView::POPUP_NONE; PageInfoBubbleView::BUBBLE_NONE;
return true; return true;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/interactive_test_utils.h"
...@@ -32,8 +32,8 @@ IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) { ...@@ -32,8 +32,8 @@ IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) {
runner1->QuitClosure()); runner1->QuitClosure());
runner1->Run(); runner1->Run();
EXPECT_EQ(PageInfoPopupView::POPUP_PAGE_INFO, EXPECT_EQ(PageInfoBubbleView::BUBBLE_PAGE_INFO,
PageInfoPopupView::GetShownPopupType()); PageInfoBubbleView::GetShownBubbleType());
// Verify that clicking again doesn't reshow it. // Verify that clicking again doesn't reshow it.
scoped_refptr<content::MessageLoopRunner> runner2 = scoped_refptr<content::MessageLoopRunner> runner2 =
...@@ -45,8 +45,8 @@ IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) { ...@@ -45,8 +45,8 @@ IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) {
runner2->QuitClosure()); runner2->QuitClosure());
runner2->Run(); runner2->Run();
EXPECT_EQ(PageInfoPopupView::POPUP_NONE, EXPECT_EQ(PageInfoBubbleView::BUBBLE_NONE,
PageInfoPopupView::GetShownPopupType()); PageInfoBubbleView::GetShownBubbleType());
} }
} // namespace } // namespace
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "chrome/browser/ui/views/page_info/chosen_object_row.h" #include "chrome/browser/ui/views/page_info/chosen_object_row.h"
#include "chrome/browser/ui/views/page_info/chosen_object_row_observer.h" #include "chrome/browser/ui/views/page_info/chosen_object_row_observer.h"
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/resources/grit/ui_resources.h" #include "ui/resources/grit/ui_resources.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_POPUP_VIEW_H_ #ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_POPUP_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_H_
#include <memory> #include <memory>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "ui/views/controls/styled_label_listener.h" #include "ui/views/controls/styled_label_listener.h"
class GURL; class GURL;
class PopupHeaderView; class BubbleHeaderView;
class Profile; class Profile;
namespace content { namespace content {
...@@ -38,7 +38,7 @@ struct SecurityInfo; ...@@ -38,7 +38,7 @@ struct SecurityInfo;
} // namespace security_state } // namespace security_state
namespace test { namespace test {
class PageInfoPopupViewTestApi; class PageInfoBubbleViewTestApi;
} }
namespace views { namespace views {
...@@ -54,7 +54,7 @@ enum : int { ...@@ -54,7 +54,7 @@ enum : int {
}; };
// The views implementation of the page info UI. // The views implementation of the page info UI.
class PageInfoPopupView : public content::WebContentsObserver, class PageInfoBubbleView : public content::WebContentsObserver,
public PermissionSelectorRowObserver, public PermissionSelectorRowObserver,
public ChosenObjectRowObserver, public ChosenObjectRowObserver,
public views::BubbleDialogDelegateView, public views::BubbleDialogDelegateView,
...@@ -63,32 +63,32 @@ class PageInfoPopupView : public content::WebContentsObserver, ...@@ -63,32 +63,32 @@ class PageInfoPopupView : public content::WebContentsObserver,
public views::StyledLabelListener, public views::StyledLabelListener,
public PageInfoUI { public PageInfoUI {
public: public:
~PageInfoPopupView() override; ~PageInfoBubbleView() override;
// Type of the popup being displayed. // Type of the bubble being displayed.
enum PopupType { enum BubbleType {
POPUP_NONE, BUBBLE_NONE,
// Usual page info bubble for websites. // Usual page info bubble for websites.
POPUP_PAGE_INFO, BUBBLE_PAGE_INFO,
// Custom bubble for internal pages like chrome:// and chrome-extensions://. // Custom bubble for internal pages like chrome:// and chrome-extensions://.
POPUP_INTERNAL_PAGE BUBBLE_INTERNAL_PAGE
}; };
// If |anchor_view| is null, |anchor_rect| is used to anchor the bubble. // If |anchor_view| is null, |anchor_rect| is used to anchor the bubble.
static void ShowPopup(views::View* anchor_view, static void ShowBubble(views::View* anchor_view,
const gfx::Rect& anchor_rect, const gfx::Rect& anchor_rect,
Profile* profile, Profile* profile,
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& url, const GURL& url,
const security_state::SecurityInfo& security_info); const security_state::SecurityInfo& security_info);
// Returns the type of the popup bubble being shown. // Returns the type of the bubble being shown.
static PopupType GetShownPopupType(); static BubbleType GetShownBubbleType();
private: private:
friend class test::PageInfoPopupViewTestApi; friend class test::PageInfoBubbleViewTestApi;
PageInfoPopupView(views::View* anchor_view, PageInfoBubbleView(views::View* anchor_view,
gfx::NativeView parent_window, gfx::NativeView parent_window,
Profile* profile, Profile* profile,
content::WebContents* web_contents, content::WebContents* web_contents,
...@@ -151,7 +151,7 @@ class PageInfoPopupView : public content::WebContentsObserver, ...@@ -151,7 +151,7 @@ class PageInfoPopupView : public content::WebContentsObserver,
Profile* profile_; Profile* profile_;
// The header section (containing security-related information). // The header section (containing security-related information).
PopupHeaderView* header_; BubbleHeaderView* header_;
// The security summary for the current page. // The security summary for the current page.
base::string16 summary_text_; base::string16 summary_text_;
...@@ -177,9 +177,9 @@ class PageInfoPopupView : public content::WebContentsObserver, ...@@ -177,9 +177,9 @@ class PageInfoPopupView : public content::WebContentsObserver,
// |Permission| changes. // |Permission| changes.
std::vector<std::unique_ptr<PermissionSelectorRow>> selector_rows_; std::vector<std::unique_ptr<PermissionSelectorRow>> selector_rows_;
base::WeakPtrFactory<PageInfoPopupView> weak_factory_; base::WeakPtrFactory<PageInfoBubbleView> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PageInfoPopupView); DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleView);
}; };
#endif // CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_POPUP_VIEW_H_ #endif // CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_BUBBLE_VIEW_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
namespace { namespace {
typedef InProcessBrowserTest PageInfoPopupViewBrowserTest; typedef InProcessBrowserTest PageInfoBubbleViewBrowserTest;
// Clicks the location icon to open the page info bubble. // Clicks the location icon to open the page info bubble.
void ClickAndWait(Browser* browser) { void ClickAndWait(Browser* browser) {
...@@ -31,41 +31,41 @@ void ClickAndWait(Browser* browser) { ...@@ -31,41 +31,41 @@ void ClickAndWait(Browser* browser) {
runner->Run(); runner->Run();
} }
IN_PROC_BROWSER_TEST_F(PageInfoPopupViewBrowserTest, ShowPopup) { IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewBrowserTest, ShowBubble) {
ClickAndWait(browser()); ClickAndWait(browser());
EXPECT_EQ(PageInfoPopupView::POPUP_PAGE_INFO, EXPECT_EQ(PageInfoBubbleView::BUBBLE_PAGE_INFO,
PageInfoPopupView::GetShownPopupType()); PageInfoBubbleView::GetShownBubbleType());
} }
IN_PROC_BROWSER_TEST_F(PageInfoPopupViewBrowserTest, ChromeURL) { IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewBrowserTest, ChromeURL) {
ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings")); ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings"));
ClickAndWait(browser()); ClickAndWait(browser());
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE, EXPECT_EQ(PageInfoBubbleView::BUBBLE_INTERNAL_PAGE,
PageInfoPopupView::GetShownPopupType()); PageInfoBubbleView::GetShownBubbleType());
} }
IN_PROC_BROWSER_TEST_F(PageInfoPopupViewBrowserTest, ChromeExtensionURL) { IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewBrowserTest, ChromeExtensionURL) {
ui_test_utils::NavigateToURL( ui_test_utils::NavigateToURL(
browser(), GURL("chrome-extension://extension-id/options.html")); browser(), GURL("chrome-extension://extension-id/options.html"));
ClickAndWait(browser()); ClickAndWait(browser());
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE, EXPECT_EQ(PageInfoBubbleView::BUBBLE_INTERNAL_PAGE,
PageInfoPopupView::GetShownPopupType()); PageInfoBubbleView::GetShownBubbleType());
} }
IN_PROC_BROWSER_TEST_F(PageInfoPopupViewBrowserTest, ChromeDevtoolsURL) { IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewBrowserTest, ChromeDevtoolsURL) {
ui_test_utils::NavigateToURL( ui_test_utils::NavigateToURL(
browser(), GURL("chrome-devtools://devtools/bundled/inspector.html")); browser(), GURL("chrome-devtools://devtools/bundled/inspector.html"));
ClickAndWait(browser()); ClickAndWait(browser());
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE, EXPECT_EQ(PageInfoBubbleView::BUBBLE_INTERNAL_PAGE,
PageInfoPopupView::GetShownPopupType()); PageInfoBubbleView::GetShownBubbleType());
} }
IN_PROC_BROWSER_TEST_F(PageInfoPopupViewBrowserTest, ViewSourceURL) { IN_PROC_BROWSER_TEST_F(PageInfoBubbleViewBrowserTest, ViewSourceURL) {
ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
chrome::ViewSelectedSource(browser()); chrome::ViewSelectedSource(browser());
ClickAndWait(browser()); ClickAndWait(browser());
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE, EXPECT_EQ(PageInfoBubbleView::BUBBLE_INTERNAL_PAGE,
PageInfoPopupView::GetShownPopupType()); PageInfoBubbleView::GetShownBubbleType());
} }
} // namespace } // namespace
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
...@@ -29,9 +29,9 @@ const char* kUrl = "http://www.example.com/index.html"; ...@@ -29,9 +29,9 @@ const char* kUrl = "http://www.example.com/index.html";
namespace test { namespace test {
class PageInfoPopupViewTestApi { class PageInfoBubbleViewTestApi {
public: public:
PageInfoPopupViewTestApi(gfx::NativeView parent, PageInfoBubbleViewTestApi(gfx::NativeView parent,
Profile* profile, Profile* profile,
content::WebContents* web_contents) content::WebContents* web_contents)
: view_(nullptr), : view_(nullptr),
...@@ -47,11 +47,11 @@ class PageInfoPopupViewTestApi { ...@@ -47,11 +47,11 @@ class PageInfoPopupViewTestApi {
security_state::SecurityInfo security_info; security_state::SecurityInfo security_info;
views::View* anchor_view = nullptr; views::View* anchor_view = nullptr;
view_ = new PageInfoPopupView(anchor_view, parent_, profile_, web_contents_, view_ = new PageInfoBubbleView(anchor_view, parent_, profile_,
GURL(kUrl), security_info); web_contents_, GURL(kUrl), security_info);
} }
PageInfoPopupView* view() { return view_; } PageInfoBubbleView* view() { return view_; }
views::View* permissions_view() { return view_->permissions_view_; } views::View* permissions_view() { return view_->permissions_view_; }
PermissionSelectorRow* GetPermissionSelectorAt(int index) { PermissionSelectorRow* GetPermissionSelectorAt(int index) {
...@@ -83,20 +83,20 @@ class PageInfoPopupViewTestApi { ...@@ -83,20 +83,20 @@ class PageInfoPopupViewTestApi {
// Simulates recreating the dialog with a new PermissionInfoList. // Simulates recreating the dialog with a new PermissionInfoList.
void SetPermissionInfo(const PermissionInfoList& list) { void SetPermissionInfo(const PermissionInfoList& list) {
for (const PageInfoPopupView::PermissionInfo& info : list) for (const PageInfoBubbleView::PermissionInfo& info : list)
view_->presenter_->OnSitePermissionChanged(info.type, info.setting); view_->presenter_->OnSitePermissionChanged(info.type, info.setting);
CreateView(); CreateView();
} }
private: private:
PageInfoPopupView* view_; // Weak. Owned by its Widget. PageInfoBubbleView* view_; // Weak. Owned by its Widget.
// For recreating the view. // For recreating the view.
gfx::NativeView parent_; gfx::NativeView parent_;
Profile* profile_; Profile* profile_;
content::WebContents* web_contents_; content::WebContents* web_contents_;
DISALLOW_COPY_AND_ASSIGN(PageInfoPopupViewTestApi); DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleViewTestApi);
}; };
} // namespace test } // namespace test
...@@ -124,9 +124,9 @@ class ScopedWebContentsTestHelper { ...@@ -124,9 +124,9 @@ class ScopedWebContentsTestHelper {
DISALLOW_COPY_AND_ASSIGN(ScopedWebContentsTestHelper); DISALLOW_COPY_AND_ASSIGN(ScopedWebContentsTestHelper);
}; };
class PageInfoPopupViewTest : public testing::Test { class PageInfoBubbleViewTest : public testing::Test {
public: public:
PageInfoPopupViewTest() {} PageInfoBubbleViewTest() {}
// testing::Test: // testing::Test:
void SetUp() override { void SetUp() override {
...@@ -137,7 +137,7 @@ class PageInfoPopupViewTest : public testing::Test { ...@@ -137,7 +137,7 @@ class PageInfoPopupViewTest : public testing::Test {
content::WebContents* web_contents = web_contents_helper_.web_contents(); content::WebContents* web_contents = web_contents_helper_.web_contents();
TabSpecificContentSettings::CreateForWebContents(web_contents); TabSpecificContentSettings::CreateForWebContents(web_contents);
api_.reset(new test::PageInfoPopupViewTestApi( api_.reset(new test::PageInfoBubbleViewTestApi(
parent_window_->GetNativeView(), web_contents_helper_.profile(), parent_window_->GetNativeView(), web_contents_helper_.profile(),
web_contents)); web_contents));
} }
...@@ -150,10 +150,10 @@ class PageInfoPopupViewTest : public testing::Test { ...@@ -150,10 +150,10 @@ class PageInfoPopupViewTest : public testing::Test {
views::ScopedViewsTestHelper views_helper_; views::ScopedViewsTestHelper views_helper_;
views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget. views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget.
std::unique_ptr<test::PageInfoPopupViewTestApi> api_; std::unique_ptr<test::PageInfoBubbleViewTestApi> api_;
private: private:
DISALLOW_COPY_AND_ASSIGN(PageInfoPopupViewTest); DISALLOW_COPY_AND_ASSIGN(PageInfoBubbleViewTest);
}; };
} // namespace } // namespace
...@@ -176,8 +176,8 @@ class PageInfoPopupViewTest : public testing::Test { ...@@ -176,8 +176,8 @@ class PageInfoPopupViewTest : public testing::Test {
constexpr int kViewsPerPermissionRow = 3; constexpr int kViewsPerPermissionRow = 3;
// Test UI construction and reconstruction via // Test UI construction and reconstruction via
// PageInfoPopupView::SetPermissionInfo(). // PageInfoBubbleView::SetPermissionInfo().
TEST_F(PageInfoPopupViewTest, MAYBE_SetPermissionInfo) { TEST_F(PageInfoBubbleViewTest, MAYBE_SetPermissionInfo) {
PermissionInfoList list(1); PermissionInfoList list(1);
list.back().type = CONTENT_SETTINGS_TYPE_GEOLOCATION; list.back().type = CONTENT_SETTINGS_TYPE_GEOLOCATION;
list.back().source = content_settings::SETTING_SOURCE_USER; list.back().source = content_settings::SETTING_SOURCE_USER;
...@@ -225,7 +225,7 @@ TEST_F(PageInfoPopupViewTest, MAYBE_SetPermissionInfo) { ...@@ -225,7 +225,7 @@ TEST_F(PageInfoPopupViewTest, MAYBE_SetPermissionInfo) {
} }
// Test UI construction and reconstruction with USB devices. // Test UI construction and reconstruction with USB devices.
TEST_F(PageInfoPopupViewTest, SetPermissionInfoWithUsbDevice) { TEST_F(PageInfoBubbleViewTest, SetPermissionInfoWithUsbDevice) {
const int kExpectedChildren = const int kExpectedChildren =
kViewsPerPermissionRow * kViewsPerPermissionRow *
(ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 11 : 13); (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 11 : 13);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "chrome/browser/ui/page_info/page_info_ui.h" #include "chrome/browser/ui/page_info/page_info_ui.h"
#include "chrome/browser/ui/page_info/permission_menu_model.h" #include "chrome/browser/ui/page_info/permission_menu_model.h"
#include "chrome/browser/ui/views/page_info/non_accessible_image_view.h" #include "chrome/browser/ui/views/page_info/non_accessible_image_view.h"
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_node_data.h"
#include "ui/base/material_design/material_design_controller.h" #include "ui/base/material_design/material_design_controller.h"
...@@ -347,7 +347,7 @@ void PermissionSelectorRow::PermissionChanged( ...@@ -347,7 +347,7 @@ void PermissionSelectorRow::PermissionChanged(
profile_, permission.type, permission.setting, profile_, permission.type, permission.setting,
permission.default_setting, content_settings::SETTING_SOURCE_USER)); permission.default_setting, content_settings::SETTING_SOURCE_USER));
menu_button_->SizeToPreferredSize(); menu_button_->SizeToPreferredSize();
// Re-layout will be done at the |PageInfoPopupView| level, since // Re-layout will be done at the |PageInfoBubbleView| level, since
// that view may need to resize itself to accomodate the new sizes of its // that view may need to resize itself to accomodate the new sizes of its
// contents. // contents.
menu_button_->InvalidateLayout(); menu_button_->InvalidateLayout();
......
...@@ -26,7 +26,7 @@ class PermissionMenuButton; ...@@ -26,7 +26,7 @@ class PermissionMenuButton;
} }
namespace test { namespace test {
class PageInfoPopupViewTestApi; class PageInfoBubbleViewTestApi;
} }
namespace views { namespace views {
...@@ -55,7 +55,7 @@ class PermissionSelectorRow { ...@@ -55,7 +55,7 @@ class PermissionSelectorRow {
void PermissionChanged(const PageInfoUI::PermissionInfo& permission); void PermissionChanged(const PageInfoUI::PermissionInfo& permission);
private: private:
friend class test::PageInfoPopupViewTestApi; friend class test::PageInfoBubbleViewTestApi;
void InitializeMenuButtonView(views::GridLayout* layout, void InitializeMenuButtonView(views::GridLayout* layout,
const PageInfoUI::PermissionInfo& permission); const PageInfoUI::PermissionInfo& permission);
......
...@@ -564,7 +564,7 @@ if (!is_android) { ...@@ -564,7 +564,7 @@ if (!is_android) {
"../browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc", "../browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc",
"../browser/ui/views/location_bar/star_view_browsertest.cc", "../browser/ui/views/location_bar/star_view_browsertest.cc",
"../browser/ui/views/omnibox/omnibox_view_views_browsertest.cc", "../browser/ui/views/omnibox/omnibox_view_views_browsertest.cc",
"../browser/ui/views/page_info/page_info_popup_view_interactive_uitest.cc", "../browser/ui/views/page_info/page_info_bubble_view_interactive_uitest.cc",
"../browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc", "../browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc",
"../browser/ui/views/passwords/manage_passwords_icon_view_interactive_uitest.cc", "../browser/ui/views/passwords/manage_passwords_icon_view_interactive_uitest.cc",
"../browser/ui/views/ssl_client_certificate_selector_browsertest.cc", "../browser/ui/views/ssl_client_certificate_selector_browsertest.cc",
...@@ -4860,7 +4860,7 @@ test("unit_tests") { ...@@ -4860,7 +4860,7 @@ test("unit_tests") {
"../browser/ui/views/confirm_bubble_views_unittest.cc", "../browser/ui/views/confirm_bubble_views_unittest.cc",
"../browser/ui/views/global_error_bubble_view_unittest.cc", "../browser/ui/views/global_error_bubble_view_unittest.cc",
"../browser/ui/views/harmony/layout_delegate_unittest.cc", "../browser/ui/views/harmony/layout_delegate_unittest.cc",
"../browser/ui/views/page_info/page_info_popup_view_unittest.cc", "../browser/ui/views/page_info/page_info_bubble_view_unittest.cc",
"../browser/ui/views/payments/credit_card_editor_view_controller_unittest.cc", "../browser/ui/views/payments/credit_card_editor_view_controller_unittest.cc",
"../browser/ui/views/payments/payment_request_item_list_unittest.cc", "../browser/ui/views/payments/payment_request_item_list_unittest.cc",
"../browser/ui/views/payments/validating_textfield_unittest.cc", "../browser/ui/views/payments/validating_textfield_unittest.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment