OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/subresource_filter/content/browser/content_activation_list_
utils.h" | 5 #include "components/subresource_filter/content/browser/content_activation_list_
utils.h" |
6 | 6 |
7 namespace subresource_filter { | 7 namespace subresource_filter { |
8 | 8 |
9 ActivationList GetListForThreatTypeAndMetadata( | 9 ActivationList GetListForThreatTypeAndMetadata( |
10 safe_browsing::SBThreatType threat_type, | 10 safe_browsing::SBThreatType threat_type, |
11 safe_browsing::ThreatPatternType threat_type_metadata) { | 11 safe_browsing::ThreatPatternType threat_type_metadata) { |
12 bool is_phishing_interstitial = | 12 bool is_phishing_interstitial = |
13 (threat_type == safe_browsing::SB_THREAT_TYPE_URL_PHISHING); | 13 (threat_type == safe_browsing::SB_THREAT_TYPE_URL_PHISHING); |
14 bool is_soc_engineering_ads_interstitial = | 14 bool is_soc_engineering_ads_interstitial = |
15 threat_type_metadata == | 15 threat_type_metadata == |
16 safe_browsing::ThreatPatternType::SOCIAL_ENGINEERING_ADS; | 16 safe_browsing::ThreatPatternType::SOCIAL_ENGINEERING_ADS; |
| 17 bool subresource_filter = |
| 18 (threat_type == safe_browsing::SB_THREAT_TYPE_SUBRESOURCE_FILTER); |
17 if (is_phishing_interstitial) { | 19 if (is_phishing_interstitial) { |
18 if (is_soc_engineering_ads_interstitial) { | 20 if (is_soc_engineering_ads_interstitial) { |
19 return ActivationList::SOCIAL_ENG_ADS_INTERSTITIAL; | 21 return ActivationList::SOCIAL_ENG_ADS_INTERSTITIAL; |
20 } | 22 } |
21 return ActivationList::PHISHING_INTERSTITIAL; | 23 return ActivationList::PHISHING_INTERSTITIAL; |
| 24 } else if (subresource_filter) { |
| 25 return ActivationList::SUBRESOURCE_FILTER; |
22 } | 26 } |
| 27 |
23 return ActivationList::NONE; | 28 return ActivationList::NONE; |
24 } | 29 } |
25 | 30 |
26 } // namespace subresource_filter | 31 } // namespace subresource_filter |
OLD | NEW |