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

Unified Diff: components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h

Issue 2645283007: Add the client for accessing Subresource Filter only list. (Closed)
Patch Set: fix HistoryNavTest Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h
new file mode 100644
index 0000000000000000000000000000000000000000..5e7cc417e7f76d1f7610ca9c82abe1e857526ada
--- /dev/null
+++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.h
@@ -0,0 +1,52 @@
+// 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.
+
+#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BROWSING_ACTIVATION_THROTTLE_H_
+#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BROWSING_ACTIVATION_THROTTLE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
+#include "components/safe_browsing_db/database_manager.h"
+#include "content/public/browser/navigation_throttle.h"
+#include "url/gurl.h"
+
+namespace subresource_filter {
+
+// Client for accessing list with patterns to be used by the Subresource Filter.
+class SubresourceFilterSafeBrowsingActivationThrottle
+ : public content::NavigationThrottle,
+ public base::SupportsWeakPtr<
+ SubresourceFilterSafeBrowsingActivationThrottle> {
+ public:
+ SubresourceFilterSafeBrowsingActivationThrottle(
+ content::NavigationHandle* handle,
+ const scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>&
+ database_manager);
+
+ ~SubresourceFilterSafeBrowsingActivationThrottle() override;
+
+ // content::NavigaionThrottle:
engedy 2017/03/02 12:00:43 typo: Navigation
melandory 2017/03/06 15:00:01 Done.
+ content::NavigationThrottle::ThrottleCheckResult WillProcessResponse()
+ override;
+
+ void OnCheckUrlResultOnUI(const GURL& url,
+ safe_browsing::SBThreatType threat_type,
+ safe_browsing::ThreatPatternType pattern_type);
+
+ private:
+ class ActivationClient;
+
+ std::unique_ptr<ActivationClient> activation_client_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(SubresourceFilterSafeBrowsingActivationThrottle);
+};
+
+} // namespace subresource_filter
+
+#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_SAFE_BROWSING_ACTIVATION_THROTTLE_H_

Powered by Google App Engine
This is Rietveld 408576698