1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/content_settings/content_settings_observable_provider.h"
7 namespace content_settings
{
9 // ////////////////////////////////////////////////////////////////////////////
13 ObservableProvider::ObservableProvider() {
16 ObservableProvider::~ObservableProvider() {
19 void ObservableProvider::AddObserver(Observer
* observer
) {
20 observer_list_
.AddObserver(observer
);
23 void ObservableProvider::RemoveObserver(Observer
* observer
) {
24 observer_list_
.RemoveObserver(observer
);
27 void ObservableProvider::NotifyObservers(
28 const ContentSettingsPattern
& primary_pattern
,
29 const ContentSettingsPattern
& secondary_pattern
,
30 ContentSettingsType content_type
,
31 const std::string
& resource_identifier
) {
32 FOR_EACH_OBSERVER(Observer
,
34 OnContentSettingChanged(
38 resource_identifier
));
41 void ObservableProvider::RemoveAllObservers() {
42 observer_list_
.Clear();
45 } // namespace content_settings