Index: chrome/browser/prefs/pref_service.h |
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h |
index 632bc8482c375ac31392e6da0402f26385a20ebc..8f993c04dcbbf92bc5f81f5eaecfb3b38967a22e 100644 |
--- a/chrome/browser/prefs/pref_service.h |
+++ b/chrome/browser/prefs/pref_service.h |
@@ -17,6 +17,7 @@ |
#include "base/values.h" |
#include "chrome/common/pref_store.h" |
+class DefaultPrefStore; |
class FilePath; |
class NotificationObserver; |
class PrefChangeObserver; |
@@ -95,11 +96,11 @@ class PrefService : public NonThreadSafe { |
DISALLOW_COPY_AND_ASSIGN(Preference); |
}; |
- // Factory method that creates a new instance of a PrefService with |
- // a PrefValueStore containing all platform-applicable PrefStores. |
- // The |pref_filename| points to the user preference file. The |profile| is |
- // the one to which these preferences apply; it may be NULL if we're dealing |
- // with the local state. This is the usual way to create a new PrefService. |
+ // Factory method that creates a new instance of a PrefService with the |
+ // applicable PrefStores. The |pref_filename| points to the user preference |
+ // file. The |profile| is the one to which these preferences apply; it may be |
+ // NULL if we're dealing with the local state. This is the usual way to create |
+ // a new PrefService. |
static PrefService* CreatePrefService(const FilePath& pref_filename, |
Profile* profile); |
@@ -109,9 +110,16 @@ class PrefService : public NonThreadSafe { |
// other types of preferences). |
static PrefService* CreateUserPrefService(const FilePath& pref_filename); |
- // This constructor is primarily used by tests. The |pref_value_store| |
- // provides preference values. |
- explicit PrefService(PrefValueStore* pref_value_store); |
+ // 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. |
+ PrefService(PrefStore* managed_platform_prefs, |
+ PrefStore* device_management_prefs, |
+ PrefStore* extension_prefs, |
+ PrefStore* command_line_prefs, |
+ PrefStore* user_prefs, |
+ PrefStore* recommended_prefs, |
+ Profile* profile); |
danno
2010/12/02 10:31:52
How about making this protected and the testingpre
Mattias Nissler (ping if slow)
2010/12/02 16:38:24
Done.
|
virtual ~PrefService(); |
@@ -221,9 +229,9 @@ class PrefService : public NonThreadSafe { |
bool ReadOnly() const; |
- PrefNotifier* pref_notifier() const { return pref_notifier_.get(); } |
- |
- PrefValueStore* pref_value_store() const { return pref_value_store_.get(); } |
+ // TODO(mnissler): This should not be public. Change client code to call a |
+ // preference setter or use ScopedPrefUpdate. |
+ PrefNotifier* pref_notifier() const; |
protected: |
// The PrefNotifier handles registering and notifying preference observers. |
@@ -271,6 +279,9 @@ class PrefService : public NonThreadSafe { |
// and owned by this PrefService. Subclasses may access it for unit testing. |
scoped_refptr<PrefValueStore> pref_value_store_; |
+ // Points to the default pref store we passed to the PrefValueStore. |
+ DefaultPrefStore* default_store_; |
+ |
// A set of all the registered Preference objects. |
PreferenceSet prefs_; |