blob: edda022d3c47e14084671d31a8ee208cce7648c1 (
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
|
// Copyright (c) 2012 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/content_settings/core/browser/content_settings_observable_provider.h"
namespace content_settings {
// ////////////////////////////////////////////////////////////////////////////
// ObservableProvider
//
ObservableProvider::ObservableProvider() {
}
ObservableProvider::~ObservableProvider() {
}
void ObservableProvider::AddObserver(Observer* observer) {
observer_list_.AddObserver(observer);
}
void ObservableProvider::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
void ObservableProvider::NotifyObservers(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
ContentSettingsType content_type,
const std::string& resource_identifier) {
FOR_EACH_OBSERVER(Observer,
observer_list_,
OnContentSettingChanged(
primary_pattern,
secondary_pattern,
content_type,
resource_identifier));
}
void ObservableProvider::RemoveAllObservers() {
observer_list_.Clear();
}
bool ObservableProvider::CalledOnValidThread() {
return thread_checker_.CalledOnValidThread();
}
} // namespace content_settings
|