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

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

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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ABSTRACT_PROVIDER_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ABSTRACT_PROVIDER_H_
7
8 #include <set>
9
10 #include "chrome/browser/content_settings/content_settings_details.h"
11 #include "chrome/browser/content_settings/content_settings_provider.h"
12 #include "chrome/browser/content_settings/content_settings_observer.h"
13
14 namespace content_settings {
15
16 class AbstractProvider : public ProviderInterface {
Bernhard Bauer 2011/07/13 07:58:18 Seeing as this class mainly manages Observers, may
markusheintz_ 2011/07/13 12:48:16 How about ObservableProvider as the provider can b
Bernhard Bauer 2011/07/13 13:21:28 Sounds good.
markusheintz_ 2011/07/13 14:14:42 Done.
17 public:
18 typedef std::set<Observer*> ObserverSet;
19
20 AbstractProvider();
21 virtual ~AbstractProvider();
22
23 void AddObserver(Observer* observer);
24 void RemoveObserver(Observer* observer);
25
26 // ProviderInterface implementation
Bernhard Bauer 2011/07/13 07:58:18 Do you need to declare these methods again?
markusheintz_ 2011/07/13 12:48:16 No I just though it might be helpful for people to
27 virtual ContentSetting GetContentSetting(
28 const GURL& primary_url,
29 const GURL& secondary_url,
30 ContentSettingsType content_type,
31 const ResourceIdentifier& resource_identifier) const = 0;
32
33 virtual void SetContentSetting(
34 const ContentSettingsPattern& primary_pattern,
35 const ContentSettingsPattern& secondary_pattern,
36 ContentSettingsType content_type,
37 const ResourceIdentifier& resource_identifier,
38 ContentSetting content_setting) = 0;
39
40 virtual void GetAllContentSettingsRules(
41 ContentSettingsType content_type,
42 const ResourceIdentifier& resource_identifier,
43 Rules* content_setting_rules) const = 0;
44
45 virtual void ClearAllContentSettingsRules(
46 ContentSettingsType content_type) = 0;
47
48 virtual void ShutdownOnUIThread() = 0;
49
50 protected:
51 void NotifyObservers(const ContentSettingsDetails& details) const;
52 void RemoveAllObserver();
Bernhard Bauer 2011/07/13 07:58:18 This method name should read |RemoveAllObservers|
markusheintz_ 2011/07/13 12:48:16 Done.
53
54 private:
55 ObserverSet observers_;
56 };
57
58 } // namespace content_settings
59
60 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_ABSTRACT_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698