blob: 649f4c915e58ca9941699a9d2553b93193ef6b96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
// Copyright 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.
#include "components/subresource_filter/content/browser/subresource_filter_observer_manager.h"
#include "components/subresource_filter/core/common/activation_state.h"
DEFINE_WEB_CONTENTS_USER_DATA_KEY(
subresource_filter::SubresourceFilterObserverManager);
namespace subresource_filter {
SubresourceFilterObserverManager::SubresourceFilterObserverManager(
content::WebContents* web_contents) {}
SubresourceFilterObserverManager::~SubresourceFilterObserverManager() {
for (auto& observer : observers_)
observer.OnSubresourceFilterGoingAway();
}
void SubresourceFilterObserverManager::AddObserver(
SubresourceFilterObserver* observer) {
observers_.AddObserver(observer);
}
void SubresourceFilterObserverManager::RemoveObserver(
SubresourceFilterObserver* observer) {
observers_.RemoveObserver(observer);
}
void SubresourceFilterObserverManager::NotifySafeBrowsingCheckComplete(
content::NavigationHandle* navigation_handle,
safe_browsing::SBThreatType threat_type,
const safe_browsing::ThreatMetadata& threat_metadata) {
for (auto& observer : observers_) {
observer.OnSafeBrowsingCheckComplete(navigation_handle, threat_type,
threat_metadata);
}
}
void SubresourceFilterObserverManager::NotifyPageActivationComputed(
content::NavigationHandle* navigation_handle,
ActivationDecision activation_decision,
const ActivationState& activation_state) {
for (auto& observer : observers_) {
observer.OnPageActivationComputed(navigation_handle, activation_decision,
activation_state);
}
}
void SubresourceFilterObserverManager::NotifySubframeNavigationEvaluated(
content::NavigationHandle* navigation_handle,
LoadPolicy load_policy,
bool is_ad_subframe) {
for (auto& observer : observers_)
observer.OnSubframeNavigationEvaluated(navigation_handle, load_policy,
is_ad_subframe);
}
} // namespace subresource_filter
|