Chromium Code Reviews| Index: chrome/browser/extensions/extension_prefs.h |
| diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h |
| index 8c8be82e15eb3db056902a833e593fe705c2bad3..3daca6a9f8222745e4b12fc2edbe2cf8b8346745 100644 |
| --- a/chrome/browser/extensions/extension_prefs.h |
| +++ b/chrome/browser/extensions/extension_prefs.h |
| @@ -11,6 +11,7 @@ |
| #include <vector> |
| #include "base/linked_ptr.h" |
| +#include "base/ref_counted.h" |
| #include "base/time.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/common/extensions/extension.h" |
| @@ -59,9 +60,12 @@ class ExtensionPrefs { |
| LAUNCH_WINDOW |
| }; |
| + // Does not assume owner ship of |prefs| and |incognito_prefs|. |
|
danno
2010/12/22 10:48:21
nit: s/owner ship/ownership/
Mattias Nissler (ping if slow)
2010/12/22 12:09:03
s/owner ship/ownership/
battre
2010/12/22 18:34:53
Done.
battre
2010/12/22 18:34:53
Done.
|
| explicit ExtensionPrefs(PrefService* prefs, |
| + PrefService* incognito_prefs, |
| const FilePath& root_dir, |
| - ExtensionPrefStore* extension_pref_store); |
| + ExtensionPrefStore* extension_pref_store, |
| + ExtensionPrefStore* incognito_pref_store); |
|
Mattias Nissler (ping if slow)
2010/12/22 12:09:03
It worries me that we need the incognito_prefs poi
battre
2010/12/22 18:34:53
Will do this in the next patch set of this CL.
|
| ~ExtensionPrefs(); |
| // Returns a copy of the Extensions prefs. |
| @@ -263,6 +267,7 @@ class ExtensionPrefs { |
| // global the extension wants to override. |
| void SetExtensionControlledPref(const std::string& extension_id, |
| const std::string& pref_key, |
| + bool incognito, |
| Value* value); |
| static void RegisterUserPrefs(PrefService* prefs); |
| @@ -335,9 +340,10 @@ class ExtensionPrefs { |
| DictionaryValue* GetExtensionPref(const std::string& id) const; |
| // Returns the dictionary of preferences controlled by the specified extension |
| - // or NULL if unknown. All entries in the dictionary contain non-expanded |
| + // or creates a new one. All entries in the dictionary contain non-expanded |
| // paths. |
| - DictionaryValue* GetExtensionControlledPrefs(const std::string& id) const; |
| + DictionaryValue* GetExtensionControlledPrefs(const std::string& id, |
| + bool incognito) const; |
| // Serializes the data and schedules a persistent save via the |PrefService|. |
| // Additionally fires a PREF_CHANGED notification with the top-level |
| @@ -370,7 +376,7 @@ class ExtensionPrefs { |
| // Returns the extension controlled preference value of the extension that was |
| // installed most recently. |
| const Value* GetWinningExtensionControlledPrefValue( |
| - const std::string& key) const; |
| + const std::string& key, bool incognito) const; |
| // Executes UpdatePrefStore for all |pref_keys|. |
| void UpdatePrefStore(const PrefKeySet& pref_keys); |
| @@ -378,21 +384,24 @@ class ExtensionPrefs { |
| // Finds the most recently installed extension that defines a preference |
| // for |pref_key|, then stores its value in the PrefValueStore's extension |
| // pref store and sends notifications to observers in case the value changed. |
| - void UpdatePrefStore(const std::string& pref_key); |
| + void UpdatePrefStore(const std::string& pref_key, bool incognito); |
| // Retrieves a list of preference keys that the specified extension |
| // intends to manage. Keys are always appended, |out| is not cleared. |
| void GetExtensionControlledPrefKeys(const std::string& extension_id, |
| PrefKeySet *out) const; |
| - // The pref service specific to this set of extension prefs. |
| + // The pref service specific to this set of extension prefs. Owned by profile. |
| PrefService* prefs_; |
| + PrefService* incognito_prefs_; |
| // Base extensions install directory. |
| FilePath install_directory_; |
| // Used to manipulate extension preferences. |
| - ExtensionPrefStore* pref_store_; |
| + scoped_refptr<ExtensionPrefStore> pref_store_; |
| + // Shared with PrefValueStore of |incognito_prefs_|. |
| + scoped_refptr<ExtensionPrefStore> incognito_pref_store_; |
| // The URLs of all of the toolstrips. |
| URLList shelf_order_; |