Index: chrome/test/base/testing_pref_service.h |
diff --git a/chrome/test/base/testing_pref_service.h b/chrome/test/base/testing_pref_service.h |
index 5c921bfd4319e5a8a840569fb78b708486ecd62f..fd726018813b86858bc1b44af76768ed4ec09ec0 100644 |
--- a/chrome/test/base/testing_pref_service.h |
+++ b/chrome/test/base/testing_pref_service.h |
@@ -6,12 +6,14 @@ |
#define CHROME_TEST_BASE_TESTING_PREF_SERVICE_H_ |
#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/prefs/testing_pref_store.h" |
+#include "chrome/browser/prefs/pref_registry.h" |
#include "chrome/browser/prefs/pref_service.h" |
-class DefaultPrefStore; |
class PrefModelAssociator; |
class PrefNotifierImpl; |
+class PrefRegistrySimple; |
class TestingBrowserProcess; |
class TestingPrefStore; |
@@ -53,7 +55,7 @@ class TestingPrefServiceBase : public SuperPrefService { |
TestingPrefStore* managed_prefs, |
TestingPrefStore* user_prefs, |
TestingPrefStore* recommended_prefs, |
- DefaultPrefStore* default_store, |
+ PrefRegistry* pref_registry, |
PrefNotifierImpl* pref_notifier); |
private: |
@@ -75,13 +77,20 @@ class TestingPrefServiceBase : public SuperPrefService { |
DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceBase); |
}; |
-// Test version of PrefServiceSimple. |
+// Test version of PrefService. |
class TestingPrefServiceSimple |
- : public TestingPrefServiceBase<PrefServiceSimple> { |
+ : public TestingPrefServiceBase<PrefService> { |
public: |
TestingPrefServiceSimple(); |
virtual ~TestingPrefServiceSimple(); |
+ // This is provided as a convenience for registering preferences on |
+ // an existing TestingPrefServiceSimple instance. On a production |
+ // PrefService you would do all registrations before constructing |
+ // it, passing it a PrefRegistry via its constructor (or via |
+ // e.g. PrefServiceBuilder). |
+ PrefRegistrySimple* registry(); |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(TestingPrefServiceSimple); |
}; |
@@ -116,11 +125,11 @@ class ScopedTestingLocalState { |
}; |
template<> |
-TestingPrefServiceBase<PrefServiceSimple>::TestingPrefServiceBase( |
+TestingPrefServiceBase<PrefService>::TestingPrefServiceBase( |
TestingPrefStore* managed_prefs, |
TestingPrefStore* user_prefs, |
TestingPrefStore* recommended_prefs, |
- DefaultPrefStore* default_store, |
+ PrefRegistry* pref_registry, |
PrefNotifierImpl* pref_notifier); |
template<> |
@@ -128,7 +137,7 @@ TestingPrefServiceBase<PrefServiceSyncable>::TestingPrefServiceBase( |
TestingPrefStore* managed_prefs, |
TestingPrefStore* user_prefs, |
TestingPrefStore* recommended_prefs, |
- DefaultPrefStore* default_store, |
+ PrefRegistry* pref_registry, |
PrefNotifierImpl* pref_notifier); |
template<class SuperPrefService> |