Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/content_settings/content_settings_abstract_provider.cc

Issue 7344008: Make the hcsm and its providers communicate via an observer interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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.
4
5 #include "chrome/browser/content_settings/content_settings_abstract_provider.h"
6
7 class ContentSettingsDetails;
8
9 namespace content_settings {
10
11 AbstractProvider::AbstractProvider() {
12 }
13
14 AbstractProvider::~AbstractProvider() {
Bernhard Bauer 2011/07/13 07:58:18 Can you add a |DCHECK(observers_.empty())|?
markusheintz_ 2011/07/13 12:48:16 Done.
Bernhard Bauer 2011/07/13 13:21:28 Actually, now that you use an |ObserverList| you c
markusheintz_ 2011/07/13 14:14:42 Done.
15 }
16
17 void AbstractProvider::AddObserver(Observer* observer) {
18 observers_.insert(observer);
19 }
20
21 void AbstractProvider::RemoveObserver(Observer* observer) {
22 observers_.erase(observer);
23 }
24
25 void AbstractProvider::NotifyObservers(
26 const ContentSettingsDetails& details) const {
27 for (ObserverSet::const_iterator observer = observers_.begin();
28 observer != observers_.end();
29 ++observer) {
30 (*observer)->OnContentSettingChanged(details);
31 }
32 }
33
34 void AbstractProvider::RemoveAllObserver() {
35 observers_.clear();
36 }
37
38 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698