Chromium Code Reviews| Index: components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h |
| diff --git a/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..886aaa3d13492c249d0fed0d3ef8b47482168785 |
| --- /dev/null |
| +++ b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2016 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. |
| + |
| +#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_NAVIGATION_THROTTLE_ |
| +#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_NAVIGATION_THROTTLE_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "content/public/browser/navigation_throttle.h" |
| +#include "url/gurl.h" |
| + |
| +namespace content { |
| +class NavigationHandle; |
| +} |
| + |
| +namespace subresource_filter { |
| + |
| +// This class has two resposibilities: |
| +// * it tracks the redirects, which are happening after Safe Browsing detects |
| +// that the page which is being loaded contains deceptive embedded content and |
| +// appends such redirects to the per-tab list. |
|
battre
2016/07/01 15:51:36
What is "the per-tab list"?
* it tracks redirects
melandory
2016/07/18 15:16:47
Done.
|
| +// * it tracks responses and passes information if deceptive embedded content |
| +// should be filtered. |
|
battre
2016/07/01 15:51:36
* it creates a ContentSubresourceFilterDriver for
melandory
2016/07/18 15:16:47
Done.
|
| +// This throttle is active only for main frame http or https navigations and |
| +// doesn't act on subresources, but activates the subresource filter when |
| +// necessary. |
|
battre
2016/07/01 15:51:36
The ", but..." part could be removed in my opinion
melandory
2016/07/18 15:16:47
Done.
|
| +class SubresourceFilterNavigationThrottle : public content::NavigationThrottle { |
| + public: |
| + static std::unique_ptr<content::NavigationThrottle> Create( |
| + content::NavigationHandle* handle); |
| + ~SubresourceFilterNavigationThrottle() override; |
| + |
| + // content::NavigationThrottle implementation: |
| + ThrottleCheckResult WillRedirectRequest() override; |
| + ThrottleCheckResult WillProcessResponse() override; |
| + |
| + private: |
| + explicit SubresourceFilterNavigationThrottle( |
| + content::NavigationHandle* navigation_handle); |
| + |
| + GURL initial_url_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SubresourceFilterNavigationThrottle); |
| +}; |
| + |
| +} // namespace subresource_filter |
| + |
| +#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_NAVIGATION_THROTTLE_ |