Add flag for interstitial warning on target embedding domains.
This CL creates a feature flag for the target embedding heuristic.
When enabled, navigating to a target embedding domain should result
in showing a lookalike interstial warning page. This CL is only for
defining the flag and integrating the flag with the interstitial will
be done in a future CL.
Bug: 1075659
Change-Id: I329a547ff147f3ccad181c2179d31dcf2ef8e675
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2171526
Reviewed-by: Joe DeBlasio <[email protected]>
Commit-Queue: Behnood Momenzadeh <[email protected]>
Cr-Commit-Position: refs/heads/master@{#763861}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 5138138..06767934 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -90,6 +90,7 @@
#include "components/games/core/games_features.h"
#include "components/invalidation/impl/invalidation_switches.h"
#include "components/language/core/common/language_experiments.h"
+#include "components/lookalikes/core/features.h"
#include "components/nacl/common/buildflags.h"
#include "components/nacl/common/nacl_switches.h"
#include "components/network_session_configurator/common/network_features.h"
@@ -3908,6 +3909,13 @@
kOsDesktop | kOsAndroid,
FEATURE_VALUE_TYPE(features::kTreatUnsafeDownloadsAsActive)},
+ {"detect-target-embedding-lookalikes",
+ flag_descriptions::kDetectTargetEmbeddingLookalikesName,
+ flag_descriptions::kDetectTargetEmbeddingLookalikesDescription,
+ kOsDesktop | kOsAndroid,
+ FEATURE_VALUE_TYPE(
+ lookalikes::features::kDetectTargetEmbeddingLookalikes)},
+
#if defined(OS_CHROMEOS)
{"enable-play-store-search", flag_descriptions::kEnablePlayStoreSearchName,
flag_descriptions::kEnablePlayStoreSearchDescription, kOsCrOS,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index dee3d6a..e8bbea0 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -764,6 +764,11 @@
"expiry_milestone": 82
},
{
+ "name": "detect-target-embedding-lookalikes",
+ "owners": [ "jdeblasio", "behnoodm" ],
+ "expiry_milestone": 86
+ },
+ {
"name": "device-discovery-notifications",
"owners": [ "thestig" ],
"expiry_milestone": 78
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 0017ed30..63a447c 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -436,6 +436,12 @@
const char kDebugShortcutsDescription[] =
"Enables additional keyboard shortcuts that are useful for debugging Ash.";
+const char kDetectTargetEmbeddingLookalikesName[] =
+ "Detect target embedding domains as lookalikes.";
+const char kDetectTargetEmbeddingLookalikesDescription[] =
+ "Shows a lookalike interstitial when navigating to target embedding domains"
+ "(e.g. google.com.example.com).";
+
const char kDeviceDiscoveryNotificationsName[] =
"Device Discovery Notifications";
const char kDeviceDiscoveryNotificationsDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index ed395300..b294027e 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -203,6 +203,9 @@
extern const char kDecodeLossyWebPImagesToYUVName[];
extern const char kDecodeLossyWebPImagesToYUVDescription[];
+extern const char kDetectTargetEmbeddingLookalikesName[];
+extern const char kDetectTargetEmbeddingLookalikesDescription[];
+
extern const char kDoubleBufferCompositingName[];
extern const char kDoubleBufferCompositingDescription[];
diff --git a/components/lookalikes/BUILD.gn b/components/lookalikes/BUILD.gn
index c28b4f05..9ace018 100644
--- a/components/lookalikes/BUILD.gn
+++ b/components/lookalikes/BUILD.gn
@@ -11,6 +11,7 @@
]
deps = [
"//base",
+ "//components/lookalikes/core:features",
"//components/security_state/core:features",
"//components/url_formatter",
"//components/url_formatter/spoof_checks/top_domains:common",
diff --git a/components/lookalikes/core/BUILD.gn b/components/lookalikes/core/BUILD.gn
new file mode 100644
index 0000000..66dfcd2
--- /dev/null
+++ b/components/lookalikes/core/BUILD.gn
@@ -0,0 +1,17 @@
+# Copyright 2020 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/jumbo.gni")
+
+component("features") {
+ output_name = "lookalikes_features"
+ defines = [ "IS_LOOKALIKES_FEATURES_IMPL" ]
+
+ sources = [
+ "features.cc",
+ "features.h",
+ ]
+
+ deps = [ "//base" ]
+}
diff --git a/components/lookalikes/core/features.cc b/components/lookalikes/core/features.cc
new file mode 100644
index 0000000..faa42a2
--- /dev/null
+++ b/components/lookalikes/core/features.cc
@@ -0,0 +1,14 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/lookalikes/core/features.h"
+
+namespace lookalikes {
+namespace features {
+
+const base::Feature kDetectTargetEmbeddingLookalikes{
+ "TargetEmbeddingLookalikes", base::FEATURE_DISABLED_BY_DEFAULT};
+
+} // namespace features
+} // namespace lookalikes
diff --git a/components/lookalikes/core/features.h b/components/lookalikes/core/features.h
new file mode 100644
index 0000000..988c1c4
--- /dev/null
+++ b/components/lookalikes/core/features.h
@@ -0,0 +1,21 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_LOOKALIKES_CORE_FEATURES_H_
+#define COMPONENTS_LOOKALIKES_CORE_FEATURES_H_
+
+#include "base/component_export.h"
+#include "base/feature_list.h"
+
+namespace lookalikes {
+namespace features {
+
+// This feature enables interstitial warnings for target embedding lookalikes.
+COMPONENT_EXPORT(LOOKALIKES_FEATURES)
+extern const base::Feature kDetectTargetEmbeddingLookalikes;
+
+} // namespace features
+} // namespace lookalikes
+
+#endif // COMPONENTS_LOOKALIKES_CORE_FEATURES_H_
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index 0f877077..b64a2fb 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -38047,6 +38047,7 @@
<int value="-1955923385" label="EnableGamepadButtonAxisEvents:enabled"/>
<int value="-1954246274"
label="enable-experimental-accessibility-switch-access"/>
+ <int value="-1953145846" label="TargetEmbeddingLookalikes:disabled"/>
<int value="-1953121360" label="EphemeralTab:disabled"/>
<int value="-1948540128" label="disable-webrtc-hw-encoding (deprecated)"/>
<int value="-1946595906" label="enable-push-api-background-mode"/>
@@ -39074,6 +39075,7 @@
<int value="-832561975" label="enable-picture-in-picture"/>
<int value="-825942229" label="tab-management-experiment-type-elderberry"/>
<int value="-824199802" label="ContextualSearchSimplifiedServer:enabled"/>
+ <int value="-823394398" label="TargetEmbeddingLookalikes:enabled"/>
<int value="-823165021" label="MaterialDesignUserMenu:enabled"/>
<int value="-820041355" label="enable-transition-compositing"/>
<int value="-816984237" label="OfflinePagesAsyncDownload:enabled"/>