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

Side by Side Diff: chrome/browser/extensions/extension_pref_value_map.h

Issue 10383262: RefCounted types should not have public destructors, delegate cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make win bot happy Created 8 years, 6 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // A = extension A, B = extension B, E = effective value 52 // A = extension A, B = extension B, E = effective value
53 // .reg = regular value 53 // .reg = regular value
54 // .reg_only = regular-only value 54 // .reg_only = regular-only value
55 // .inc = incognito value 55 // .inc = incognito value
56 // Extension B has higher precedence than A. 56 // Extension B has higher precedence than A.
57 class ExtensionPrefValueMap : public ProfileKeyedService { 57 class ExtensionPrefValueMap : public ProfileKeyedService {
58 public: 58 public:
59 // Observer interface for monitoring ExtensionPrefValueMap. 59 // Observer interface for monitoring ExtensionPrefValueMap.
60 class Observer { 60 class Observer {
61 public: 61 public:
62 virtual ~Observer() {}
63
64 // Called when the value for the given |key| set by one of the extensions 62 // Called when the value for the given |key| set by one of the extensions
65 // changes. This does not necessarily mean that the effective value has 63 // changes. This does not necessarily mean that the effective value has
66 // changed. 64 // changed.
67 virtual void OnPrefValueChanged(const std::string& key) = 0; 65 virtual void OnPrefValueChanged(const std::string& key) = 0;
68 // Notification about the ExtensionPrefValueMap being fully initialized. 66 // Notification about the ExtensionPrefValueMap being fully initialized.
69 virtual void OnInitializationCompleted() = 0; 67 virtual void OnInitializationCompleted() = 0;
70 // Called when the ExtensionPrefValueMap is being destroyed. When called, 68 // Called when the ExtensionPrefValueMap is being destroyed. When called,
71 // observers must unsubscribe. 69 // observers must unsubscribe.
72 virtual void OnExtensionPrefValueMapDestruction() = 0; 70 virtual void OnExtensionPrefValueMapDestruction() = 0;
71
72 protected:
73 virtual ~Observer() {}
73 }; 74 };
74 75
75 ExtensionPrefValueMap(); 76 ExtensionPrefValueMap();
76 virtual ~ExtensionPrefValueMap(); 77 virtual ~ExtensionPrefValueMap();
77 78
78 // ProfileKeyedService implementation. 79 // ProfileKeyedService implementation.
79 virtual void Shutdown() OVERRIDE; 80 virtual void Shutdown() OVERRIDE;
80 81
81 // Set an extension preference |value| for |key| of extension |ext_id|. 82 // Set an extension preference |value| for |key| of extension |ext_id|.
82 // Takes ownership of |value|. 83 // Takes ownership of |value|.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // being destroyed. In tests, it isn't called, so the notification must 182 // being destroyed. In tests, it isn't called, so the notification must
182 // be done in the destructor. This bit tracks whether it has been done yet. 183 // be done in the destructor. This bit tracks whether it has been done yet.
183 bool destroyed_; 184 bool destroyed_;
184 185
185 ObserverList<Observer, true> observers_; 186 ObserverList<Observer, true> observers_;
186 187
187 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); 188 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap);
188 }; 189 };
189 190
190 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ 191 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/bundle_installer.h ('k') | chrome/browser/extensions/webstore_install_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698