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,
LookalikeUrlNavigationThrottle::LookalikeUrlNavigationThrottle(
content::NavigationHandle* navigation_handle)
: content::NavigationThrottle(navigation_handle),
interstitials_enabled_(base::FeatureList::IsEnabled(
features::kLookalikeUrlNavigationSuggestionsUI)),
profile_(Profile::FromBrowserContext(
navigation_handle->GetWebContents()->GetBrowserContext())) {}
......@@ -177,11 +175,6 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::HandleThrottleRequest(
base::BindOnce(&LookalikeUrlNavigationThrottle::PerformChecksDeferred,
weak_factory_.GetWeakPtr(), url, navigated_domain,
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;
}
......@@ -272,10 +265,6 @@ void LookalikeUrlNavigationThrottle::PerformChecksDeferred(
ThrottleCheckResult result =
PerformChecks(url, navigated_domain, check_safe_redirect, engaged_sites);
if (!interstitials_enabled_) {
return;
}
if (result.action() == content::NavigationThrottle::PROCEED) {
Resume();
return;
......@@ -327,8 +316,7 @@ ThrottleCheckResult LookalikeUrlNavigationThrottle::PerformChecks(
return content::NavigationThrottle::PROCEED;
}
if (interstitials_enabled_ &&
ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
if (ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
// matched_domain can be a top domain or an engaged domain. Simply use its
// eTLD+1 as the suggested domain.
// 1. If matched_domain is a top domain: Top domain list already contains
......
......@@ -76,8 +76,6 @@ class LookalikeUrlNavigationThrottle : public content::NavigationThrottle {
ukm::SourceId source_id,
LookalikeUrlMatchType match_type);
bool interstitials_enabled_;
Profile* profile_;
base::WeakPtrFactory<LookalikeUrlNavigationThrottle> weak_factory_{this};
};
......
......@@ -55,9 +55,7 @@ bool ShouldTriggerSafetyTipFromLookalike(
}
// If we're already displaying an interstitial, don't warn again.
if (base::FeatureList::IsEnabled(
features::kLookalikeUrlNavigationSuggestionsUI) &&
ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
if (ShouldBlockLookalikeUrlNavigation(match_type, navigated_domain)) {
return false;
}
......@@ -73,16 +71,14 @@ bool ShouldTriggerSafetyTipFromLookalike(
return false;
case LookalikeUrlMatchType::kTargetEmbeddingForSafetyTips:
return kEnableLookalikeTargetEmbedding.Get();
case LookalikeUrlMatchType::kSkeletonMatchTop5k:
return kEnableLookalikeTopSites.Get();
case LookalikeUrlMatchType::kSiteEngagement:
case LookalikeUrlMatchType::kSkeletonMatchTop500:
// We should only ever reach these cases when the lookalike interstitial
// is disabled. Now that interstitial is fully launched, this only happens
// in tests.
DCHECK(!base::FeatureList::IsEnabled(
features::kLookalikeUrlNavigationSuggestionsUI));
return true;
case LookalikeUrlMatchType::kSkeletonMatchTop5k:
return kEnableLookalikeTopSites.Get();
FALLTHROUGH;
case LookalikeUrlMatchType::kNone:
NOTREACHED();
}
......
......@@ -408,12 +408,6 @@ const base::Feature kHideCorsMitigationListPolicySupport{
// (formerly DataSaver).
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)
// A feature that controls whether Chrome warns about incompatible applications.
// This feature requires Windows 10 or higher to work because it depends on
......
......@@ -284,9 +284,6 @@ extern const base::Feature kKernelnextVMs;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kLiteVideo;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kLookalikeUrlNavigationSuggestionsUI;
#if defined(OS_MACOSX)
COMPONENT_EXPORT(CHROME_FEATURES)
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