Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: chrome/browser/subresource_filter/navigation_throttle_util.cc

Issue 2770153004: Unittests for the Safe Browsing Subresource filter navigation throttle (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/subresource_filter/subresource_filter_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/subresource_filter/navigation_throttle_util.h" 5 #include "chrome/browser/subresource_filter/navigation_throttle_util.h"
6 6
7 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 7 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
8 #include "components/safe_browsing_db/database_manager.h" 8 #include "components/safe_browsing_db/database_manager.h"
9 #include "components/safe_browsing_db/v4_feature_list.h" 9 #include "components/safe_browsing_db/v4_feature_list.h"
10 #include "components/subresource_filter/content/browser/subresource_filter_safe_ browsing_activation_throttle.h" 10 #include "components/subresource_filter/content/browser/subresource_filter_safe_ browsing_activation_throttle.h"
11 #include "components/subresource_filter/core/browser/subresource_filter_features .h" 11 #include "components/subresource_filter/core/browser/subresource_filter_features .h"
12 #include "content/public/browser/navigation_handle.h" 12 #include "content/public/browser/navigation_handle.h"
13 13
14 content::NavigationThrottle* MaybeCreateSubresourceFilterNavigationThrottle( 14 content::NavigationThrottle* MaybeCreateSubresourceFilterNavigationThrottle(
15 content::NavigationHandle* navigation_handle, 15 content::NavigationHandle* navigation_handle,
16 safe_browsing::SafeBrowsingService* safe_browsing_service) { 16 safe_browsing::SafeBrowsingService* safe_browsing_service) {
17 bool feature_enabled = base::FeatureList::IsEnabled( 17 if (navigation_handle->IsInMainFrame() && safe_browsing_service &&
18 subresource_filter::kSubresourceFilterSafeBrowsingActivationThrottle);
19 if (feature_enabled && navigation_handle->IsInMainFrame() &&
20 safe_browsing_service &&
21 safe_browsing_service->database_manager()->IsSupported() && 18 safe_browsing_service->database_manager()->IsSupported() &&
22 safe_browsing::V4FeatureList::GetV4UsageStatus() == 19 safe_browsing::V4FeatureList::GetV4UsageStatus() ==
23 safe_browsing::V4FeatureList::V4UsageStatus::V4_ONLY) { 20 safe_browsing::V4FeatureList::V4UsageStatus::V4_ONLY) {
24 return new subresource_filter:: 21 return new subresource_filter::
25 SubresourceFilterSafeBrowsingActivationThrottle( 22 SubresourceFilterSafeBrowsingActivationThrottle(
26 navigation_handle, safe_browsing_service->database_manager()); 23 navigation_handle, safe_browsing_service->database_manager());
27 } 24 }
28 return nullptr; 25 return nullptr;
29 } 26 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/subresource_filter/subresource_filter_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698