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

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

Issue 2858483003: [subresource_filter] Move throttle insertion into the client (Closed)
Patch Set: fix rebase Created 3 years, 7 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/subresource_filter/navigation_throttle_util.h"
6
7 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
8 #include "components/safe_browsing_db/database_manager.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"
11 #include "components/subresource_filter/core/browser/subresource_filter_features .h"
12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/browser/navigation_handle.h"
14
15 content::NavigationThrottle* MaybeCreateSubresourceFilterNavigationThrottle(
16 content::NavigationHandle* navigation_handle,
17 safe_browsing::SafeBrowsingService* safe_browsing_service) {
18 if (navigation_handle->IsInMainFrame() && safe_browsing_service &&
19 safe_browsing_service->database_manager()->IsSupported() &&
20 safe_browsing::V4FeatureList::GetV4UsageStatus() ==
21 safe_browsing::V4FeatureList::V4UsageStatus::V4_ONLY) {
22 return new subresource_filter::
23 SubresourceFilterSafeBrowsingActivationThrottle(
24 navigation_handle,
25 content::BrowserThread::GetTaskRunnerForThread(
26 content::BrowserThread::IO),
27 safe_browsing_service->database_manager());
28 }
29 return nullptr;
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698