Index: chrome/browser/prefs/pref_service.h |
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h |
index 3002e9d38db81480ae78cf854f8ab7f3849b53cb..bd6696c5a7e062eba2b73c8db0a9edcf211cf423 100644 |
--- a/chrome/browser/prefs/pref_service.h |
+++ b/chrome/browser/prefs/pref_service.h |
@@ -146,6 +146,10 @@ class PrefService : public base::NonThreadSafe { |
// incognito windows). |
PrefService* CreateIncognitoPrefService(PrefStore* incognito_extension_prefs); |
+ // Creates a per-tab copy of the pref service that shares most pref stores |
+ // and allows WebKit-related preferences to be overridden on per-tab basis. |
+ PrefService* CreatePrefServiceWithPerTabPrefStore(); |
+ |
virtual ~PrefService(); |
// Reloads the data from file. This should only be called when the importer |
@@ -297,9 +301,8 @@ class PrefService : public base::NonThreadSafe { |
SyncableService* GetSyncableService(); |
protected: |
- // Construct a new pref service, specifying the pref sources as explicit |
- // PrefStore pointers. This constructor is what CreatePrefService() ends up |
- // calling. It's also used for unit tests. |
+ // Construct a new pref service. This constructor is what |
+ // CreatePrefService() ends up calling and what is used for unit tests. |
PrefService(PrefStore* managed_platform_prefs, |
PrefStore* managed_cloud_prefs, |
PrefStore* extension_prefs, |
@@ -307,13 +310,19 @@ class PrefService : public base::NonThreadSafe { |
PersistentPrefStore* user_prefs, |
PrefStore* recommended_platform_prefs, |
PrefStore* recommended_cloud_prefs, |
- DefaultPrefStore* default_store, |
bool async); |
- // The PrefNotifier handles registering and notifying preference observers. |
- // It is created and owned by this PrefService. Subclasses may access it for |
- // unit testing. |
- scoped_ptr<PrefNotifierImpl> pref_notifier_; |
+ // An overloaded version that clones and specializes value store. |
+ // Used for CreateIncognito and Create...PerTabPrefStore. |
+ PrefService(PrefValueStore* source_store, |
+ PrefStore* managed_platform_prefs, |
+ PrefStore* managed_cloud_prefs, |
+ PrefStore* extension_prefs, |
+ PrefStore* command_line_prefs, |
+ PersistentPrefStore* user_prefs, |
+ PrefStore* recommended_platform_prefs, |
+ PrefStore* recommended_cloud_prefs, |
+ DefaultPrefStore* default_store); |
Mattias Nissler (ping if slow)
2011/11/17 20:08:13
Oh, I had totally missed that there's now a second
mnaganov (inactive)
2011/11/18 11:20:45
The difference between them is that the first one
mnaganov (inactive)
2011/11/18 11:24:48
In theory, we can exploit multiple inheritance her
Mattias Nissler (ping if slow)
2011/11/18 12:01:37
Ah, I remember :) TestingPrefServiceBase was origi
mnaganov (inactive)
2011/11/18 14:35:05
I have discovered a nice trick that in constructor
|
private: |
class PreferencePathComparator { |
@@ -338,11 +347,6 @@ class PrefService : public base::NonThreadSafe { |
// Give access to ReportUserPrefChanged() and GetMutableUserPref(). |
friend class subtle::ScopedUserPrefUpdateBase; |
- // Construct an incognito version of the pref service. Use |
- // CreateIncognitoPrefService() instead of calling this constructor directly. |
- PrefService(const PrefService& original, |
- PrefStore* incognito_extension_prefs); |
- |
// Sends notification of a changed preference. This needs to be called by |
// a ScopedUserPrefUpdate if a DictionaryValue or ListValue is changed. |
void ReportUserPrefChanged(const std::string& key); |
@@ -382,9 +386,9 @@ class PrefService : public base::NonThreadSafe { |
base::Value* GetMutableUserPref(const char* path, |
base::Value::Type type); |
- // The PrefValueStore provides prioritized preference values. It is created |
- // and owned by this PrefService. Subclasses may access it for unit testing. |
- scoped_ptr<PrefValueStore> pref_value_store_; |
+ // The PrefNotifier handles registering and notifying preference observers. |
+ // It is created and owned by this PrefService. |
+ scoped_ptr<PrefNotifierImpl> pref_notifier_; |
// Pref Stores and profile that we passed to the PrefValueStore. |
scoped_refptr<PersistentPrefStore> user_pref_store_; |
@@ -398,6 +402,10 @@ class PrefService : public base::NonThreadSafe { |
// The model associator that maintains the links with the sync db. |
scoped_ptr<PrefModelAssociator> pref_sync_associator_; |
+ // The PrefValueStore provides prioritized preference values. It is created |
+ // and owned by this PrefService. Subclasses may access it for unit testing. |
+ scoped_ptr<PrefValueStore> pref_value_store_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PrefService); |
}; |