Commit 31921389 authored by Mustafa Emre Acer's avatar Mustafa Emre Acer Committed by Commit Bot

Remove kEnableLookalikeNavigationSuggestionUI feature

The feature is fully launched and we now have allowlists pushed by the
component updater. Remove the flag and clean up the tests.

Change-Id: I86a2da492ae09748306f2c68846090cba05bff02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2253020
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
Reviewed-by: default avatarLivvie Lin <livvielin@chromium.org>
Reviewed-by: default avatarJoe DeBlasio <jdeblasio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780095}
parent 06ba4e5f
...@@ -87,8 +87,6 @@ bool IsSafeRedirect(const std::string& matching_domain, ...@@ -87,8 +87,6 @@ bool IsSafeRedirect(const std::string& matching_domain,
LookalikeUrlNavigationThrottle::LookalikeUrlNavigationThrottle( LookalikeUrlNavigationThrottle::LookalikeUrlNavigationThrottle(
content::NavigationHandle* navigation_handle) content::NavigationHandle* navigation_handle)
: content::NavigationThrottle(navigation_handle), : content::NavigationThrottle(navigation_handle),
interstitials_enabled_(base::FeatureList::IsEnabled(
features::kLookalikeUrlNavigationSuggestionsUI)),
profile_(Profile::FromBrowserContext( profile_(Profile::FromBrowserContext(
navigation_handle->GetWebContents()->GetBrowserContext())) {} navigation_handle->GetWebContents()->GetBrowserContext())) {}
...@@ -177,11 +175,6 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::HandleThrottleRequest( ...@@ -177,11 +175,6 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::HandleThrottleRequest(
base::BindOnce(&LookalikeUrlNavigationThrottle::PerformChecksDeferred, base::BindOnce(&LookalikeUrlNavigationThrottle::PerformChecksDeferred,
weak_factory_.GetWeakPtr(), url, navigated_domain, weak_factory_.GetWeakPtr(), url, navigated_domain,
check_safe_redirect)); check_safe_redirect));
// If we're not going to show an interstitial, there's no reason to delay
// the navigation any further.
if (!interstitials_enabled_) {
return content::NavigationThrottle::PROCEED;
}
return content::NavigationThrottle::DEFER; return content::NavigationThrottle::DEFER;
} }
...@@ -272,10 +265,6 @@ void LookalikeUrlNavigationThrottle::PerformChecksDeferred( ...@@ -272,10 +265,6 @@ void LookalikeUrlNavigationThrottle::PerformChecksDeferred(
ThrottleCheckResult result = ThrottleCheckResult result =
PerformChecks(url, navigated_domain, check_safe_redirect, engaged_sites); PerformChecks(url, navigated_domain, check_safe_redirect, engaged_sites);
if (!interstitials_enabled_) {
return;
}
if (result.action() == content::NavigationThrottle::PROCEED) { if (result.action() == content::NavigationThrottle::PROCEED) {
Resume(); Resume();
return; return;
...@@ -327,8 +316,7 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::PerformChecks( ...@@ -327,8 +316,7 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::PerformChecks(
return content::NavigationThrottle::PROCEED; return content::NavigationThrottle::PROCEED;
} }
if (interstitials_enabled_ && if (ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
// matched_domain can be a top domain or an engaged domain. Simply use its // matched_domain can be a top domain or an engaged domain. Simply use its
// eTLD+1 as the suggested domain. // eTLD+1 as the suggested domain.
// 1. If matched_domain is a top domain: Top domain list already contains // 1. If matched_domain is a top domain: Top domain list already contains
......
...@@ -76,8 +76,6 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle { ...@@ -76,8 +76,6 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle {
ukm::SourceId source_id, ukm::SourceId source_id,
LookalikeUrlMatchType match_type); LookalikeUrlMatchType match_type);
bool interstitials_enabled_;
Profile* profile_; Profile* profile_;
base::WeakPtrFactory<LookalikeUrlNavigationThrottle> weak_factory_{this}; base::WeakPtrFactory<LookalikeUrlNavigationThrottle> weak_factory_{this};
}; };
......
...@@ -55,9 +55,7 @@ bool ShouldTriggerSafetyTipFromLookalike( ...@@ -55,9 +55,7 @@ bool ShouldTriggerSafetyTipFromLookalike(
} }
// If we're already displaying an interstitial, don't warn again. // If we're already displaying an interstitial, don't warn again.
if (base::FeatureList::IsEnabled( if (ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
features::kLookalikeUrlNavigationSuggestionsUI) &&
ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
return false; return false;
} }
...@@ -73,16 +71,14 @@ bool ShouldTriggerSafetyTipFromLookalike( ...@@ -73,16 +71,14 @@ bool ShouldTriggerSafetyTipFromLookalike(
return false; return false;
case LookalikeUrlMatchType::kTargetEmbeddingForSafetyTips: case LookalikeUrlMatchType::kTargetEmbeddingForSafetyTips:
return kEnableLookalikeTargetEmbedding.Get(); return kEnableLookalikeTargetEmbedding.Get();
case LookalikeUrlMatchType::kSkeletonMatchTop5k:
return kEnableLookalikeTopSites.Get();
case LookalikeUrlMatchType::kSiteEngagement: case LookalikeUrlMatchType::kSiteEngagement:
case LookalikeUrlMatchType::kSkeletonMatchTop500: case LookalikeUrlMatchType::kSkeletonMatchTop500:
// We should only ever reach these cases when the lookalike interstitial // We should only ever reach these cases when the lookalike interstitial
// is disabled. Now that interstitial is fully launched, this only happens // is disabled. Now that interstitial is fully launched, this only happens
// in tests. // in tests.
DCHECK(!base::FeatureList::IsEnabled( FALLTHROUGH;
features::kLookalikeUrlNavigationSuggestionsUI));
return true;
case LookalikeUrlMatchType::kSkeletonMatchTop5k:
return kEnableLookalikeTopSites.Get();
case LookalikeUrlMatchType::kNone: case LookalikeUrlMatchType::kNone:
NOTREACHED(); NOTREACHED();
} }
......
...@@ -408,12 +408,6 @@ const base::Feature kHideCorsMitigationListPolicySupport{ ...@@ -408,12 +408,6 @@ const base::Feature kHideCorsMitigationListPolicySupport{
// (formerly DataSaver). // (formerly DataSaver).
const base::Feature kLiteVideo{"LiteVideo", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kLiteVideo{"LiteVideo", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables navigation suggestions UI for lookalike URLs (e.g. internationalized
// domain names that are visually similar to popular domains or to domains with
// engagement score, such as googlé.com).
const base::Feature kLookalikeUrlNavigationSuggestionsUI{
"LookalikeUrlNavigationSuggestionsUI", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_WIN) #if defined(OS_WIN)
// A feature that controls whether Chrome warns about incompatible applications. // A feature that controls whether Chrome warns about incompatible applications.
// This feature requires Windows 10 or higher to work because it depends on // This feature requires Windows 10 or higher to work because it depends on
......
...@@ -284,9 +284,6 @@ extern const base::Feature kKernelnextVMs; ...@@ -284,9 +284,6 @@ extern const base::Feature kKernelnextVMs;
COMPONENT_EXPORT(CHROME_FEATURES) COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kLiteVideo; extern const base::Feature kLiteVideo;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kLookalikeUrlNavigationSuggestionsUI;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES) COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kMacFullSizeContentView; extern const base::Feature kMacFullSizeContentView;
......
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