Index: components/subresource_filter/content/browser/content_activation_list_utils.cc |
diff --git a/components/subresource_filter/content/browser/content_activation_list_utils.cc b/components/subresource_filter/content/browser/content_activation_list_utils.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6689d600a6be3fc5ef7b0af4d4cd22b01d88a7fe |
--- /dev/null |
+++ b/components/subresource_filter/content/browser/content_activation_list_utils.cc |
@@ -0,0 +1,26 @@ |
+// Copyright 2017 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/subresource_filter/content/browser/content_activation_list_utils.h" |
+ |
+namespace subresource_filter { |
+ |
+ActivationList GetListForThreatTypeAndMetadata( |
+ safe_browsing::SBThreatType threat_type, |
+ safe_browsing::ThreatPatternType threat_type_metadata) { |
+ bool is_phishing_interstitial = |
+ (threat_type == safe_browsing::SB_THREAT_TYPE_URL_PHISHING); |
+ bool is_soc_engineering_ads_interstitial = |
+ threat_type_metadata == |
+ safe_browsing::ThreatPatternType::SOCIAL_ENGINEERING_ADS; |
+ if (is_phishing_interstitial) { |
+ if (is_soc_engineering_ads_interstitial) { |
+ return ActivationList::SOCIAL_ENG_ADS_INTERSTITIAL; |
+ } |
+ return ActivationList::PHISHING_INTERSTITIAL; |
+ } |
+ return ActivationList::NONE; |
+} |
+ |
+} // namespace subresource_filter |