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 COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER
_THROTTLE_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 : public content::WebContentsObserver { | 46 : public content::WebContentsObserver { |
47 public: | 47 public: |
48 // It is expected that the Delegate outlives |this|, and manages the lifetime | 48 // It is expected that the Delegate outlives |this|, and manages the lifetime |
49 // of this class. | 49 // of this class. |
50 class Delegate { | 50 class Delegate { |
51 public: | 51 public: |
52 // The embedder may be interested in displaying UI to the user when the | 52 // The embedder may be interested in displaying UI to the user when the |
53 // first load is disallowed for a given page load. | 53 // first load is disallowed for a given page load. |
54 virtual void OnFirstSubresourceLoadDisallowed() {} | 54 virtual void OnFirstSubresourceLoadDisallowed() {} |
55 | 55 |
56 // Let the delegate have the last word when it comes to activation. It might | |
57 // have a specific whitelist. | |
58 virtual bool ShouldSuppressActivation( | |
59 content::NavigationHandle* navigation_handle); | |
60 | |
61 // Temporary method to help the delegate compute the activation decision. | 56 // Temporary method to help the delegate compute the activation decision. |
62 virtual void WillProcessResponse( | 57 virtual void WillProcessResponse( |
63 content::NavigationHandle* navigation_handle) {} | 58 content::NavigationHandle* navigation_handle) {} |
64 }; | 59 }; |
65 | 60 |
66 ContentSubresourceFilterThrottleManager( | 61 ContentSubresourceFilterThrottleManager( |
67 Delegate* delegate, | 62 Delegate* delegate, |
68 VerifiedRulesetDealer::Handle* dealer_handle, | 63 VerifiedRulesetDealer::Handle* dealer_handle, |
69 content::WebContents* web_contents); | 64 content::WebContents* web_contents); |
70 ~ContentSubresourceFilterThrottleManager() override; | 65 ~ContentSubresourceFilterThrottleManager() override; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 161 |
167 base::WeakPtrFactory<ContentSubresourceFilterThrottleManager> | 162 base::WeakPtrFactory<ContentSubresourceFilterThrottleManager> |
168 weak_ptr_factory_; | 163 weak_ptr_factory_; |
169 | 164 |
170 DISALLOW_COPY_AND_ASSIGN(ContentSubresourceFilterThrottleManager); | 165 DISALLOW_COPY_AND_ASSIGN(ContentSubresourceFilterThrottleManager); |
171 }; | 166 }; |
172 | 167 |
173 } // namespace subresource_filter | 168 } // namespace subresource_filter |
174 | 169 |
175 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FIL
TER_THROTTLE_MANAGER_H_ | 170 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FIL
TER_THROTTLE_MANAGER_H_ |
OLD | NEW |