| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/aw_safe_browsing_ui_manager.h" | 8 #include "android_webview/browser/aw_safe_browsing_ui_manager.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/safe_browsing/base_resource_throttle.h" | 10 #include "components/safe_browsing/base_resource_throttle.h" |
| 11 #include "components/safe_browsing_db/database_manager.h" | 11 #include "components/safe_browsing_db/database_manager.h" |
| 12 #include "components/security_interstitials/content/unsafe_resource.h" | 12 #include "components/security_interstitials/content/unsafe_resource.h" |
| 13 #include "content/public/common/resource_type.h" | 13 #include "content/public/common/resource_type.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 class URLRequest; | 16 class URLRequest; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace android_webview { | 19 namespace android_webview { |
| 20 | 20 |
| 21 safe_browsing::ResourceThrottle* MaybeCreateAwSafeBrowsingResourceThrottle( |
| 22 net::URLRequest* request, |
| 23 content::ResourceType resource_type, |
| 24 scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager> database_manager, |
| 25 scoped_refptr<AwSafeBrowsingUIManager> ui_manager); |
| 26 |
| 21 class AwSafeBrowsingResourceThrottle | 27 class AwSafeBrowsingResourceThrottle |
| 22 : public safe_browsing::BaseResourceThrottle { | 28 : public safe_browsing::BaseResourceThrottle { |
| 23 public: | 29 public: |
| 24 // Will construct an AwSafeBrowsingResourceThrottle if GMS exists on device | 30 // Will construct an AwSafeBrowsingResourceThrottle if GMS exists on device |
| 25 // and supports safebrowsing. | 31 // and supports safebrowsing. |
| 26 static AwSafeBrowsingResourceThrottle* MaybeCreate( | 32 static AwSafeBrowsingResourceThrottle* MaybeCreate( |
| 27 net::URLRequest* request, | 33 net::URLRequest* request, |
| 28 content::ResourceType resource_type, | 34 content::ResourceType resource_type, |
| 29 scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager> | 35 scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager> |
| 30 database_manager, | 36 database_manager, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 41 ~AwSafeBrowsingResourceThrottle() override; | 47 ~AwSafeBrowsingResourceThrottle() override; |
| 42 | 48 |
| 43 void CancelResourceLoad() override; | 49 void CancelResourceLoad() override; |
| 44 | 50 |
| 45 DISALLOW_COPY_AND_ASSIGN(AwSafeBrowsingResourceThrottle); | 51 DISALLOW_COPY_AND_ASSIGN(AwSafeBrowsingResourceThrottle); |
| 46 }; | 52 }; |
| 47 | 53 |
| 48 } // namespace android_webview | 54 } // namespace android_webview |
| 49 | 55 |
| 50 #endif // ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_ | 56 #endif // ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_ |
| OLD | NEW |