Chromium Code Reviews| Index: chrome/browser/subresource_filter/subresource_filter_navigation_trottle_util.cc |
| diff --git a/chrome/browser/subresource_filter/subresource_filter_navigation_trottle_util.cc b/chrome/browser/subresource_filter/subresource_filter_navigation_trottle_util.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..65372188d2e11e27114de1a039abf68860632434 |
| --- /dev/null |
| +++ b/chrome/browser/subresource_filter/subresource_filter_navigation_trottle_util.cc |
| @@ -0,0 +1,26 @@ |
| +// Copyright (c) 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 "chrome/browser/subresource_filter/subresource_filter_navigation_trottle_util.h" |
| + |
| +#include "base/memory/ptr_util.h" |
| +#include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| +#include "components/safe_browsing_db/v4_feature_list.h" |
| +#include "components/subresource_filter/content/browser/subresource_filter_activation_navigation_throttle.h" |
| +#include "content/public/browser/navigation_handle.h" |
| + |
| +std::unique_ptr<content::NavigationThrottle> |
| +MaybeCreateSubresourceFilterNavigationThrottle( |
| + content::NavigationHandle* handle, |
| + safe_browsing::SafeBrowsingService* sb_service) { |
| + if (handle->IsInMainFrame() && |
| + sb_service->database_manager()->IsSupported() && |
| + (safe_browsing::V4FeatureList::IsV4HybridEnabled() || |
|
vakh (use Gerrit instead)
2017/02/10 03:00:12
these methods are going away soon so don't be surp
melandory
2017/02/14 17:40:34
Rebased on top of it.
|
| + safe_browsing::V4FeatureList::IsV4OnlyEnabled())) { |
| + return base::WrapUnique( |
| + new subresource_filter::SubresourceFilterActivationNavigationThrottle( |
| + handle, sb_service->v4_local_database_manager())); |
| + } |
| + return nullptr; |
| +} |