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

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

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 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 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // 1 | - | 3 | 4 | 5 | - | 5 | 4 46 // 1 | - | 3 | 4 | 5 | - | 5 | 4
47 // 1 | - | - | - | - | 6 | 1 | 6 47 // 1 | - | - | - | - | 6 | 1 | 6
48 // 1 | 2 | - | 4 | - | 6 | 4 | 6 48 // 1 | 2 | - | 4 | - | 6 | 4 | 6
49 // 1 | 2 | 3 | - | 5 | 6 | 5 | 6 49 // 1 | 2 | 3 | - | 5 | 6 | 5 | 6
50 // 50 //
51 // A = extension A, B = extension B, E = effective value 51 // A = extension A, B = extension B, E = effective value
52 // .reg = regular value 52 // .reg = regular value
53 // .reg_only = regular-only value 53 // .reg_only = regular-only value
54 // .inc = incognito value 54 // .inc = incognito value
55 // Extension B has higher precedence than A. 55 // Extension B has higher precedence than A.
56 class ExtensionPrefValueMap : public ProfileKeyedService { 56 class ExtensionPrefValueMap : public BrowserContextKeyedService {
57 public: 57 public:
58 // Observer interface for monitoring ExtensionPrefValueMap. 58 // Observer interface for monitoring ExtensionPrefValueMap.
59 class Observer { 59 class Observer {
60 public: 60 public:
61 // Called when the value for the given |key| set by one of the extensions 61 // Called when the value for the given |key| set by one of the extensions
62 // changes. This does not necessarily mean that the effective value has 62 // changes. This does not necessarily mean that the effective value has
63 // changed. 63 // changed.
64 virtual void OnPrefValueChanged(const std::string& key) = 0; 64 virtual void OnPrefValueChanged(const std::string& key) = 0;
65 // Notification about the ExtensionPrefValueMap being fully initialized. 65 // Notification about the ExtensionPrefValueMap being fully initialized.
66 virtual void OnInitializationCompleted() = 0; 66 virtual void OnInitializationCompleted() = 0;
67 // Called when the ExtensionPrefValueMap is being destroyed. When called, 67 // Called when the ExtensionPrefValueMap is being destroyed. When called,
68 // observers must unsubscribe. 68 // observers must unsubscribe.
69 virtual void OnExtensionPrefValueMapDestruction() = 0; 69 virtual void OnExtensionPrefValueMapDestruction() = 0;
70 70
71 protected: 71 protected:
72 virtual ~Observer() {} 72 virtual ~Observer() {}
73 }; 73 };
74 74
75 ExtensionPrefValueMap(); 75 ExtensionPrefValueMap();
76 virtual ~ExtensionPrefValueMap(); 76 virtual ~ExtensionPrefValueMap();
77 77
78 // ProfileKeyedService implementation. 78 // BrowserContextKeyedService implementation.
79 virtual void Shutdown() OVERRIDE; 79 virtual void Shutdown() OVERRIDE;
80 80
81 // Set an extension preference |value| for |key| of extension |ext_id|. 81 // Set an extension preference |value| for |key| of extension |ext_id|.
82 // Takes ownership of |value|. 82 // Takes ownership of |value|.
83 // Note that regular extension pref values need to be reported to 83 // Note that regular extension pref values need to be reported to
84 // incognito and to regular ExtensionPrefStores. 84 // incognito and to regular ExtensionPrefStores.
85 // Precondition: the extension must be registered. 85 // Precondition: the extension must be registered.
86 void SetExtensionPref(const std::string& ext_id, 86 void SetExtensionPref(const std::string& ext_id,
87 const std::string& key, 87 const std::string& key,
88 extensions::ExtensionPrefsScope scope, 88 extensions::ExtensionPrefsScope scope,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // being destroyed. In tests, it isn't called, so the notification must 184 // being destroyed. In tests, it isn't called, so the notification must
185 // be done in the destructor. This bit tracks whether it has been done yet. 185 // be done in the destructor. This bit tracks whether it has been done yet.
186 bool destroyed_; 186 bool destroyed_;
187 187
188 ObserverList<Observer, true> observers_; 188 ObserverList<Observer, true> observers_;
189 189
190 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); 190 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap);
191 }; 191 };
192 192
193 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ 193 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698