Commit d9bca519 authored by Livvie Lin's avatar Livvie Lin Committed by Commit Bot

Rename LookalikeUrlInterstitialPage to LookalikeUrlBlockingPage

Match the naming convention of SSL blocking pages for consistency.

Design doc: go/security-interstitial-cleanup

Bug: 1042467
Change-Id: Ie6f26e8f5494bfcbdc3cd7a76e99dbd967f74dc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076759Reviewed-by: default avatarJoe DeBlasio <jdeblasio@chromium.org>
Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Livvie Lin <livvielin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746260}
parent 7dc570ba
...@@ -653,10 +653,10 @@ jumbo_static_library("browser") { ...@@ -653,10 +653,10 @@ jumbo_static_library("browser") {
"local_search_service/local_search_service_proxy.h", "local_search_service/local_search_service_proxy.h",
"local_search_service/local_search_service_proxy_factory.cc", "local_search_service/local_search_service_proxy_factory.cc",
"local_search_service/local_search_service_proxy_factory.h", "local_search_service/local_search_service_proxy_factory.h",
"lookalikes/lookalike_url_blocking_page.cc",
"lookalikes/lookalike_url_blocking_page.h",
"lookalikes/lookalike_url_controller_client.cc", "lookalikes/lookalike_url_controller_client.cc",
"lookalikes/lookalike_url_controller_client.h", "lookalikes/lookalike_url_controller_client.h",
"lookalikes/lookalike_url_interstitial_page.cc",
"lookalikes/lookalike_url_interstitial_page.h",
"lookalikes/lookalike_url_navigation_throttle.cc", "lookalikes/lookalike_url_navigation_throttle.cc",
"lookalikes/lookalike_url_navigation_throttle.h", "lookalikes/lookalike_url_navigation_throttle.h",
"lookalikes/lookalike_url_service.cc", "lookalikes/lookalike_url_service.cc",
......
...@@ -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/lookalikes/lookalike_url_interstitial_page.h" #include "chrome/browser/lookalikes/lookalike_url_blocking_page.h"
#include <utility> #include <utility>
...@@ -23,10 +23,10 @@ using security_interstitials::MetricsHelper; ...@@ -23,10 +23,10 @@ using security_interstitials::MetricsHelper;
// static // static
const content::InterstitialPageDelegate::TypeID const content::InterstitialPageDelegate::TypeID
LookalikeUrlInterstitialPage::kTypeForTesting = LookalikeUrlBlockingPage::kTypeForTesting =
&LookalikeUrlInterstitialPage::kTypeForTesting; &LookalikeUrlBlockingPage::kTypeForTesting;
LookalikeUrlInterstitialPage::LookalikeUrlInterstitialPage( LookalikeUrlBlockingPage::LookalikeUrlBlockingPage(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& request_url, const GURL& request_url,
ukm::SourceId source_id, ukm::SourceId source_id,
...@@ -45,9 +45,9 @@ LookalikeUrlInterstitialPage::LookalikeUrlInterstitialPage( ...@@ -45,9 +45,9 @@ LookalikeUrlInterstitialPage::LookalikeUrlInterstitialPage(
MetricsHelper::TOTAL_VISITS); MetricsHelper::TOTAL_VISITS);
} }
LookalikeUrlInterstitialPage::~LookalikeUrlInterstitialPage() {} LookalikeUrlBlockingPage::~LookalikeUrlBlockingPage() {}
void LookalikeUrlInterstitialPage::ReportUkmIfNeeded(UserAction action) { void LookalikeUrlBlockingPage::ReportUkmIfNeeded(UserAction action) {
// We rely on the saved SourceId because deconstruction happens after the next // We rely on the saved SourceId because deconstruction happens after the next
// navigation occurs, so web contents points to the new destination. // navigation occurs, so web contents points to the new destination.
if (source_id_ != ukm::kInvalidSourceId) { if (source_id_ != ukm::kInvalidSourceId) {
...@@ -57,10 +57,10 @@ void LookalikeUrlInterstitialPage::ReportUkmIfNeeded(UserAction action) { ...@@ -57,10 +57,10 @@ void LookalikeUrlInterstitialPage::ReportUkmIfNeeded(UserAction action) {
} }
// static // static
void LookalikeUrlInterstitialPage::RecordUkmEvent( void LookalikeUrlBlockingPage::RecordUkmEvent(
ukm::SourceId source_id, ukm::SourceId source_id,
LookalikeUrlInterstitialPage::MatchType match_type, LookalikeUrlBlockingPage::MatchType match_type,
LookalikeUrlInterstitialPage::UserAction user_action) { LookalikeUrlBlockingPage::UserAction user_action) {
ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get(); ukm::UkmRecorder* ukm_recorder = ukm::UkmRecorder::Get();
CHECK(ukm_recorder); CHECK(ukm_recorder);
...@@ -71,15 +71,15 @@ void LookalikeUrlInterstitialPage::RecordUkmEvent( ...@@ -71,15 +71,15 @@ void LookalikeUrlInterstitialPage::RecordUkmEvent(
} }
content::InterstitialPageDelegate::TypeID content::InterstitialPageDelegate::TypeID
LookalikeUrlInterstitialPage::GetTypeForTesting() { LookalikeUrlBlockingPage::GetTypeForTesting() {
return LookalikeUrlInterstitialPage::kTypeForTesting; return LookalikeUrlBlockingPage::kTypeForTesting;
} }
bool LookalikeUrlInterstitialPage::ShouldCreateNewNavigation() const { bool LookalikeUrlBlockingPage::ShouldCreateNewNavigation() const {
return true; return true;
} }
void LookalikeUrlInterstitialPage::PopulateInterstitialStrings( void LookalikeUrlBlockingPage::PopulateInterstitialStrings(
base::DictionaryValue* load_time_data) { base::DictionaryValue* load_time_data) {
CHECK(load_time_data); CHECK(load_time_data);
...@@ -103,16 +103,16 @@ void LookalikeUrlInterstitialPage::PopulateInterstitialStrings( ...@@ -103,16 +103,16 @@ void LookalikeUrlInterstitialPage::PopulateInterstitialStrings(
l10n_util::GetStringFUTF16(IDS_LOOKALIKE_URL_CONTINUE, hostname)); l10n_util::GetStringFUTF16(IDS_LOOKALIKE_URL_CONTINUE, hostname));
} }
void LookalikeUrlInterstitialPage::OnInterstitialClosing() { void LookalikeUrlBlockingPage::OnInterstitialClosing() {
ReportUkmIfNeeded(UserAction::kCloseOrBack); ReportUkmIfNeeded(UserAction::kCloseOrBack);
} }
bool LookalikeUrlInterstitialPage::ShouldDisplayURL() const { bool LookalikeUrlBlockingPage::ShouldDisplayURL() const {
return false; return false;
} }
// This handles the commands sent from the interstitial JavaScript. // This handles the commands sent from the interstitial JavaScript.
void LookalikeUrlInterstitialPage::CommandReceived(const std::string& command) { void LookalikeUrlBlockingPage::CommandReceived(const std::string& command) {
if (command == "\"pageLoadComplete\"") { if (command == "\"pageLoadComplete\"") {
// content::WaitForRenderFrameReady sends this message when the page // content::WaitForRenderFrameReady sends this message when the page
// load completes. Ignore it. // load completes. Ignore it.
...@@ -158,11 +158,11 @@ void LookalikeUrlInterstitialPage::CommandReceived(const std::string& command) { ...@@ -158,11 +158,11 @@ void LookalikeUrlInterstitialPage::CommandReceived(const std::string& command) {
} }
} }
int LookalikeUrlInterstitialPage::GetHTMLTemplateId() { int LookalikeUrlBlockingPage::GetHTMLTemplateId() {
return IDR_SECURITY_INTERSTITIAL_HTML; return IDR_SECURITY_INTERSTITIAL_HTML;
} }
void LookalikeUrlInterstitialPage::PopulateStringsForSharedHTML( void LookalikeUrlBlockingPage::PopulateStringsForSharedHTML(
base::DictionaryValue* load_time_data) { base::DictionaryValue* load_time_data) {
load_time_data->SetBoolean("lookalike_url", true); load_time_data->SetBoolean("lookalike_url", true);
load_time_data->SetBoolean("overridable", false); load_time_data->SetBoolean("overridable", false);
......
...@@ -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_LOOKALIKES_LOOKALIKE_URL_INTERSTITIAL_PAGE_H_ #ifndef CHROME_BROWSER_LOOKALIKES_LOOKALIKE_URL_BLOCKING_PAGE_H_
#define CHROME_BROWSER_LOOKALIKES_LOOKALIKE_URL_INTERSTITIAL_PAGE_H_ #define CHROME_BROWSER_LOOKALIKES_LOOKALIKE_URL_BLOCKING_PAGE_H_
#include <memory> #include <memory>
#include <string> #include <string>
...@@ -19,7 +19,7 @@ class GURL; ...@@ -19,7 +19,7 @@ class GURL;
// This class is responsible for showing/hiding the interstitial page that // This class is responsible for showing/hiding the interstitial page that
// occurs when a new domain is visited and it looks suspiciously like another // occurs when a new domain is visited and it looks suspiciously like another
// more popular domain. // more popular domain.
class LookalikeUrlInterstitialPage class LookalikeUrlBlockingPage
: public security_interstitials::SecurityInterstitialPage { : public security_interstitials::SecurityInterstitialPage {
public: public:
// Interstitial type, used in tests. // Interstitial type, used in tests.
...@@ -50,7 +50,7 @@ class LookalikeUrlInterstitialPage ...@@ -50,7 +50,7 @@ class LookalikeUrlInterstitialPage
kMaxValue = kCloseOrBack, kMaxValue = kCloseOrBack,
}; };
LookalikeUrlInterstitialPage( LookalikeUrlBlockingPage(
content::WebContents* web_contents, content::WebContents* web_contents,
const GURL& request_url, const GURL& request_url,
ukm::SourceId source_id, ukm::SourceId source_id,
...@@ -59,7 +59,7 @@ class LookalikeUrlInterstitialPage ...@@ -59,7 +59,7 @@ class LookalikeUrlInterstitialPage
security_interstitials::SecurityInterstitialControllerClient> security_interstitials::SecurityInterstitialControllerClient>
controller); controller);
~LookalikeUrlInterstitialPage() override; ~LookalikeUrlBlockingPage() override;
// InterstitialPageDelegate method: // InterstitialPageDelegate method:
InterstitialPageDelegate::TypeID GetTypeForTesting() override; InterstitialPageDelegate::TypeID GetTypeForTesting() override;
...@@ -93,7 +93,7 @@ class LookalikeUrlInterstitialPage ...@@ -93,7 +93,7 @@ class LookalikeUrlInterstitialPage
ukm::SourceId source_id_; ukm::SourceId source_id_;
MatchType match_type_; MatchType match_type_;
DISALLOW_COPY_AND_ASSIGN(LookalikeUrlInterstitialPage); DISALLOW_COPY_AND_ASSIGN(LookalikeUrlBlockingPage);
}; };
#endif // CHROME_BROWSER_LOOKALIKES_LOOKALIKE_URL_INTERSTITIAL_PAGE_H_ #endif // CHROME_BROWSER_LOOKALIKES_LOOKALIKE_URL_BLOCKING_PAGE_H_
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/engagement/site_engagement_service.h" #include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/lookalikes/lookalike_url_blocking_page.h"
#include "chrome/browser/lookalikes/lookalike_url_controller_client.h" #include "chrome/browser/lookalikes/lookalike_url_controller_client.h"
#include "chrome/browser/lookalikes/lookalike_url_interstitial_page.h"
#include "chrome/browser/lookalikes/lookalike_url_service.h" #include "chrome/browser/lookalikes/lookalike_url_service.h"
#include "chrome/browser/lookalikes/lookalike_url_tab_storage.h" #include "chrome/browser/lookalikes/lookalike_url_tab_storage.h"
#include "chrome/browser/prerender/prerender_contents.h" #include "chrome/browser/prerender/prerender_contents.h"
...@@ -36,8 +36,8 @@ namespace { ...@@ -36,8 +36,8 @@ namespace {
const base::FeatureParam<bool> kEnableInterstitialForTopSites{ const base::FeatureParam<bool> kEnableInterstitialForTopSites{
&features::kLookalikeUrlNavigationSuggestionsUI, "topsites", true}; &features::kLookalikeUrlNavigationSuggestionsUI, "topsites", true};
using MatchType = LookalikeUrlInterstitialPage::MatchType; using MatchType = LookalikeUrlBlockingPage::MatchType;
using UserAction = LookalikeUrlInterstitialPage::UserAction; using UserAction = LookalikeUrlBlockingPage::UserAction;
using url_formatter::TopDomainEntry; using url_formatter::TopDomainEntry;
typedef content::NavigationThrottle::ThrottleCheckResult ThrottleCheckResult; typedef content::NavigationThrottle::ThrottleCheckResult ThrottleCheckResult;
...@@ -405,9 +405,9 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::ShowInterstitial( ...@@ -405,9 +405,9 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::ShowInterstitial(
auto controller = std::make_unique<LookalikeUrlControllerClient>( auto controller = std::make_unique<LookalikeUrlControllerClient>(
web_contents, url, safe_url); web_contents, url, safe_url);
std::unique_ptr<LookalikeUrlInterstitialPage> blocking_page( std::unique_ptr<LookalikeUrlBlockingPage> blocking_page(
new LookalikeUrlInterstitialPage(web_contents, safe_url, source_id, new LookalikeUrlBlockingPage(web_contents, safe_url, source_id,
match_type, std::move(controller))); match_type, std::move(controller)));
base::Optional<std::string> error_page_contents = base::Optional<std::string> error_page_contents =
blocking_page->GetHTMLContents(); blocking_page->GetHTMLContents();
...@@ -609,8 +609,8 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::PerformChecks( ...@@ -609,8 +609,8 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::PerformChecks(
} }
// Interstitial normally records UKM, but still record when it's not shown. // Interstitial normally records UKM, but still record when it's not shown.
LookalikeUrlInterstitialPage::RecordUkmEvent( LookalikeUrlBlockingPage::RecordUkmEvent(source_id, match_type,
source_id, match_type, UserAction::kInterstitialNotShown); UserAction::kInterstitialNotShown);
return content::NavigationThrottle::PROCEED; return content::NavigationThrottle::PROCEED;
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/engagement/site_engagement_details.mojom.h" #include "chrome/browser/engagement/site_engagement_details.mojom.h"
#include "chrome/browser/lookalikes/lookalike_url_interstitial_page.h" #include "chrome/browser/lookalikes/lookalike_url_blocking_page.h"
#include "components/url_formatter/url_formatter.h" #include "components/url_formatter/url_formatter.h"
#include "content/public/browser/navigation_throttle.h" #include "content/public/browser/navigation_throttle.h"
#include "services/metrics/public/cpp/ukm_source_id.h" #include "services/metrics/public/cpp/ukm_source_id.h"
...@@ -75,7 +75,7 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle { ...@@ -75,7 +75,7 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle {
MaybeCreateNavigationThrottle(content::NavigationHandle* navigation_handle); MaybeCreateNavigationThrottle(content::NavigationHandle* navigation_handle);
static bool ShouldDisplayInterstitial( static bool ShouldDisplayInterstitial(
LookalikeUrlInterstitialPage::MatchType match_type, LookalikeUrlBlockingPage::MatchType match_type,
const DomainInfo& navigated_domain); const DomainInfo& navigated_domain);
// Returns true if a domain is visually similar to the hostname of |url|. The // Returns true if a domain is visually similar to the hostname of |url|. The
...@@ -87,7 +87,7 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle { ...@@ -87,7 +87,7 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle {
const DomainInfo& navigated_domain, const DomainInfo& navigated_domain,
const std::vector<DomainInfo>& engaged_sites, const std::vector<DomainInfo>& engaged_sites,
std::string* matched_domain, std::string* matched_domain,
LookalikeUrlInterstitialPage::MatchType* match_type); LookalikeUrlBlockingPage::MatchType* match_type);
private: private:
FRIEND_TEST_ALL_PREFIXES(LookalikeUrlNavigationThrottleTest, FRIEND_TEST_ALL_PREFIXES(LookalikeUrlNavigationThrottleTest,
...@@ -116,7 +116,7 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle { ...@@ -116,7 +116,7 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle {
const GURL& safe_domain, const GURL& safe_domain,
const GURL& url, const GURL& url,
ukm::SourceId source_id, ukm::SourceId source_id,
LookalikeUrlInterstitialPage::MatchType match_type); LookalikeUrlBlockingPage::MatchType match_type);
bool interstitials_enabled_; bool interstitials_enabled_;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "chrome/browser/engagement/site_engagement_service.h" #include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/history_test_utils.h" #include "chrome/browser/history/history_test_utils.h"
#include "chrome/browser/lookalikes/lookalike_url_interstitial_page.h" #include "chrome/browser/lookalikes/lookalike_url_blocking_page.h"
#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h" #include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
#include "chrome/browser/lookalikes/lookalike_url_service.h" #include "chrome/browser/lookalikes/lookalike_url_service.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
...@@ -38,8 +38,8 @@ using security_interstitials::MetricsHelper; ...@@ -38,8 +38,8 @@ using security_interstitials::MetricsHelper;
using security_interstitials::SecurityInterstitialCommand; using security_interstitials::SecurityInterstitialCommand;
using UkmEntry = ukm::builders::LookalikeUrl_NavigationSuggestion; using UkmEntry = ukm::builders::LookalikeUrl_NavigationSuggestion;
using MatchType = LookalikeUrlInterstitialPage::MatchType; using MatchType = LookalikeUrlBlockingPage::MatchType;
using UserAction = LookalikeUrlInterstitialPage::UserAction; using UserAction = LookalikeUrlBlockingPage::UserAction;
enum class UIStatus { enum class UIStatus {
// Enabled for all heuristics. // Enabled for all heuristics.
...@@ -127,7 +127,7 @@ void LoadAndCheckInterstitialAt(Browser* browser, const GURL& url) { ...@@ -127,7 +127,7 @@ void LoadAndCheckInterstitialAt(Browser* browser, const GURL& url) {
EXPECT_EQ(nullptr, GetCurrentInterstitial(web_contents)); EXPECT_EQ(nullptr, GetCurrentInterstitial(web_contents));
NavigateToURLSync(browser, url); NavigateToURLSync(browser, url);
EXPECT_EQ(LookalikeUrlInterstitialPage::kTypeForTesting, EXPECT_EQ(LookalikeUrlBlockingPage::kTypeForTesting,
GetInterstitialType(web_contents)); GetInterstitialType(web_contents));
EXPECT_FALSE(IsUrlShowing(browser)); EXPECT_FALSE(IsUrlShowing(browser));
} }
...@@ -143,7 +143,7 @@ void SendInterstitialCommandSync(Browser* browser, ...@@ -143,7 +143,7 @@ void SendInterstitialCommandSync(Browser* browser,
content::WebContents* web_contents = content::WebContents* web_contents =
browser->tab_strip_model()->GetActiveWebContents(); browser->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(LookalikeUrlInterstitialPage::kTypeForTesting, EXPECT_EQ(LookalikeUrlBlockingPage::kTypeForTesting,
GetInterstitialType(web_contents)); GetInterstitialType(web_contents));
content::TestNavigationObserver navigation_observer(web_contents, 1); content::TestNavigationObserver navigation_observer(web_contents, 1);
...@@ -384,7 +384,7 @@ class LookalikeUrlNavigationThrottleBrowserTest ...@@ -384,7 +384,7 @@ class LookalikeUrlNavigationThrottleBrowserTest
base::SimpleTestClock test_clock_; base::SimpleTestClock test_clock_;
}; };
class LookalikeUrlInterstitialPageBrowserTest class LookalikeUrlBlockingPageBrowserTest
: public LookalikeUrlNavigationThrottleBrowserTest { : public LookalikeUrlNavigationThrottleBrowserTest {
protected: protected:
UIStatus ui_status() const override { return UIStatus::kEnabled; } UIStatus ui_status() const override { return UIStatus::kEnabled; }
...@@ -912,7 +912,7 @@ IN_PROC_BROWSER_TEST_P(LookalikeUrlNavigationThrottleBrowserTest, ...@@ -912,7 +912,7 @@ IN_PROC_BROWSER_TEST_P(LookalikeUrlNavigationThrottleBrowserTest,
// Navigate to lookalike domains that redirect to benign domains and ensure that // Navigate to lookalike domains that redirect to benign domains and ensure that
// we display an interstitial along the way. // we display an interstitial along the way.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
Interstitial_CapturesRedirects) { Interstitial_CapturesRedirects) {
{ {
// Verify it works when the lookalike domain is the first in the chain // Verify it works when the lookalike domain is the first in the chain
...@@ -961,7 +961,7 @@ IN_PROC_BROWSER_TEST_P(LookalikeUrlNavigationThrottleBrowserTest, ...@@ -961,7 +961,7 @@ IN_PROC_BROWSER_TEST_P(LookalikeUrlNavigationThrottleBrowserTest,
// Verify that the user action in UKM is recorded even when we navigate away // Verify that the user action in UKM is recorded even when we navigate away
// from the interstitial without interacting with it. // from the interstitial without interacting with it.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
UkmRecordedAfterNavigateAway) { UkmRecordedAfterNavigateAway) {
const GURL navigated_url = GetURL("googlé.com"); const GURL navigated_url = GetURL("googlé.com");
const GURL subsequent_url = GetURL("example.com"); const GURL subsequent_url = GetURL("example.com");
...@@ -973,7 +973,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -973,7 +973,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
// Verify that the user action in UKM is recorded properly when the user accepts // Verify that the user action in UKM is recorded properly when the user accepts
// the navigation suggestion. // the navigation suggestion.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
UkmRecordedAfterSuggestionAccepted) { UkmRecordedAfterSuggestionAccepted) {
const GURL navigated_url = GetURL("googlé.com"); const GURL navigated_url = GetURL("googlé.com");
...@@ -985,7 +985,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -985,7 +985,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
// Verify that the user action in UKM is recorded properly when the user ignores // Verify that the user action in UKM is recorded properly when the user ignores
// the navigation suggestion. // the navigation suggestion.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
UkmRecordedAfterSuggestionIgnored) { UkmRecordedAfterSuggestionIgnored) {
const GURL navigated_url = GetURL("googlé.com"); const GURL navigated_url = GetURL("googlé.com");
...@@ -996,7 +996,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -996,7 +996,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
} }
// Verify that the URL shows normally on pages after a lookalike interstitial. // Verify that the URL shows normally on pages after a lookalike interstitial.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
UrlShownAfterInterstitial) { UrlShownAfterInterstitial) {
LoadAndCheckInterstitialAt(browser(), GetURL("googlé.com")); LoadAndCheckInterstitialAt(browser(), GetURL("googlé.com"));
...@@ -1006,7 +1006,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -1006,7 +1006,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
} }
// Verify that bypassing warnings in the main profile does not affect incognito. // Verify that bypassing warnings in the main profile does not affect incognito.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
MainProfileDoesNotAffectIncognito) { MainProfileDoesNotAffectIncognito) {
const GURL kNavigatedUrl = GetURL("googlé.com"); const GURL kNavigatedUrl = GetURL("googlé.com");
...@@ -1024,7 +1024,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -1024,7 +1024,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
} }
// Verify that bypassing warnings in incognito does not affect the main profile. // Verify that bypassing warnings in incognito does not affect the main profile.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
IncognitoDoesNotAffectMainProfile) { IncognitoDoesNotAffectMainProfile) {
const GURL kNavigatedUrl = GetURL("sité1.com"); const GURL kNavigatedUrl = GetURL("sité1.com");
const GURL kEngagedUrl = GetURL("site1.com"); const GURL kEngagedUrl = GetURL("site1.com");
...@@ -1046,7 +1046,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -1046,7 +1046,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
// Verify reloading the page does not result in dismissing an interstitial. // Verify reloading the page does not result in dismissing an interstitial.
// Regression test for crbug/941886. // Regression test for crbug/941886.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlBlockingPageBrowserTest,
RefreshDoesntDismiss) { RefreshDoesntDismiss) {
// Verify it works when the lookalike domain is the first in the chain. // Verify it works when the lookalike domain is the first in the chain.
const GURL kNavigatedUrl = const GURL kNavigatedUrl =
...@@ -1064,7 +1064,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -1064,7 +1064,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
navigation_observer.Wait(); navigation_observer.Wait();
EXPECT_EQ(LookalikeUrlInterstitialPage::kTypeForTesting, EXPECT_EQ(LookalikeUrlBlockingPage::kTypeForTesting,
GetInterstitialType(web_contents)); GetInterstitialType(web_contents));
EXPECT_FALSE(IsUrlShowing(browser())); EXPECT_FALSE(IsUrlShowing(browser()));
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "base/metrics/field_trial_params.h" #include "base/metrics/field_trial_params.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "chrome/browser/lookalikes/lookalike_url_interstitial_page.h" #include "chrome/browser/lookalikes/lookalike_url_blocking_page.h"
#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h" #include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
#include "chrome/browser/lookalikes/lookalike_url_service.h" #include "chrome/browser/lookalikes/lookalike_url_service.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
namespace { namespace {
using MatchType = LookalikeUrlInterstitialPage::MatchType; using MatchType = LookalikeUrlBlockingPage::MatchType;
const base::FeatureParam<bool> kEnableLookalikeTopSites{ const base::FeatureParam<bool> kEnableLookalikeTopSites{
&security_state::features::kSafetyTipUI, "topsites", true}; &security_state::features::kSafetyTipUI, "topsites", true};
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "chrome/browser/lookalikes/lookalike_url_interstitial_page.h" #include "chrome/browser/lookalikes/lookalike_url_blocking_page.h"
#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h" #include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
#include "chrome/browser/lookalikes/lookalike_url_service.h" #include "chrome/browser/lookalikes/lookalike_url_service.h"
#include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/incognito_helpers.h"
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/lookalikes/lookalike_url_blocking_page.h"
#include "chrome/browser/lookalikes/lookalike_url_controller_client.h" #include "chrome/browser/lookalikes/lookalike_url_controller_client.h"
#include "chrome/browser/lookalikes/lookalike_url_interstitial_page.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h"
...@@ -258,14 +258,14 @@ std::unique_ptr<BadClockBlockingPage> CreateBadClockBlockingPage( ...@@ -258,14 +258,14 @@ std::unique_ptr<BadClockBlockingPage> CreateBadClockBlockingPage(
clock_state, nullptr); clock_state, nullptr);
} }
std::unique_ptr<LookalikeUrlInterstitialPage> CreateLookalikeInterstitialPage( std::unique_ptr<LookalikeUrlBlockingPage> CreateLookalikeInterstitialPage(
content::WebContents* web_contents) { content::WebContents* web_contents) {
GURL request_url("https://example.net"); GURL request_url("https://example.net");
GURL safe_url("https://example.com"); GURL safe_url("https://example.com");
return std::make_unique<LookalikeUrlInterstitialPage>( return std::make_unique<LookalikeUrlBlockingPage>(
web_contents, safe_url, ukm::kInvalidSourceId, web_contents, safe_url, ukm::kInvalidSourceId,
LookalikeUrlInterstitialPage::MatchType::kNone, LookalikeUrlBlockingPage::MatchType::kNone,
std::make_unique<LookalikeUrlControllerClient>(web_contents, request_url, std::make_unique<LookalikeUrlControllerClient>(web_contents, request_url,
safe_url)); safe_url));
} }
......
...@@ -4793,14 +4793,14 @@ be describing additional metrics about the same event. ...@@ -4793,14 +4793,14 @@ be describing additional metrics about the same event.
<metric name="MatchType"> <metric name="MatchType">
<summary> <summary>
An enum value representing the type of the match (popular domain, engaged An enum value representing the type of the match (popular domain, engaged
domain, etc.). The enum is defined in |LookalikeUrlInterstitialPage|. domain, etc.). The enum is defined in |LookalikeUrlBlockingPage|.
</summary> </summary>
</metric> </metric>
<metric name="UserAction"> <metric name="UserAction">
<summary> <summary>
An enum value representing the decision the user made when shown an An enum value representing the decision the user made when shown an
interstitial (ignored, suggestion_accepted, etc.). The enum is defined in interstitial (ignored, suggestion_accepted, etc.). The enum is defined in
|LookalikeUrlInterstitialPage|. |LookalikeUrlBlockingPage|.
</summary> </summary>
</metric> </metric>
</event> </event>
......
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