| 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_SUBRESOURCE_FILTER_OBSERVE
R_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_OBSERVE
R_H_ |
| 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_OBSERVE
R_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_OBSERVE
R_H_ |
| 7 | 7 |
| 8 #include "components/subresource_filter/core/common/activation_decision.h" | 8 #include "components/subresource_filter/core/common/activation_decision.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 class NavigationHandle; | 11 class NavigationHandle; |
| 12 } // namespace content | 12 } // namespace content |
| 13 | 13 |
| 14 namespace subresource_filter { | 14 namespace subresource_filter { |
| 15 | 15 |
| 16 struct ActivationState; | 16 struct ActivationState; |
| 17 | 17 |
| 18 // Class to receive notifications of subresource filter events for a given | 18 // Class to receive notifications of subresource filter events for a given |
| 19 // WebContents. Registered with a SubresourceFilterObserverManager. | 19 // WebContents. Registered with a SubresourceFilterObserverManager. |
| 20 class SubresourceFilterObserver { | 20 class SubresourceFilterObserver { |
| 21 public: | 21 public: |
| 22 virtual ~SubresourceFilterObserver() = default; | 22 virtual ~SubresourceFilterObserver() = default; |
| 23 | 23 |
| 24 // Called before the observer manager is destroyed. Observers must unregister |
| 25 // themselves by this point. |
| 24 virtual void OnSubresourceFilterGoingAway() {} | 26 virtual void OnSubresourceFilterGoingAway() {} |
| 25 | 27 |
| 28 // Called at most once per navigation when page activation is computed. This |
| 29 // will be called before ReadyToCommitNavigation. |
| 26 virtual void OnPageActivationComputed( | 30 virtual void OnPageActivationComputed( |
| 27 content::NavigationHandle* navigation_handle, | 31 content::NavigationHandle* navigation_handle, |
| 28 ActivationDecision activation_decision, | 32 ActivationDecision activation_decision, |
| 29 const ActivationState& activation_state) {} | 33 const ActivationState& activation_state) {} |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 } // namespace subresource_filter | 36 } // namespace subresource_filter |
| 33 | 37 |
| 34 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_OBSE
RVER_H_ | 38 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_SUBRESOURCE_FILTER_OBSE
RVER_H_ |
| OLD | NEW |