Index: chrome/browser/prefs/pref_service.h |
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h |
index bf904a4cf176d0c06a5120531f2d41c10df1fc9c..b9e4dd866ffc5f14303c7f382469c316d025bb0b 100644 |
--- a/chrome/browser/prefs/pref_service.h |
+++ b/chrome/browser/prefs/pref_service.h |
@@ -35,13 +35,7 @@ class ScopedUserPrefUpdateBase; |
class PrefService; |
-class PrefServiceDelegate { |
- public: |
- virtual void OnPrefsLoaded(PrefService* prefs, bool success) = 0; |
-}; |
- |
-class PrefService : public base::NonThreadSafe, |
- public JsonPrefStore::Delegate { |
+class PrefService : public base::NonThreadSafe { |
public: |
// A helper class to store all the information associated with a preference. |
class Preference { |
@@ -120,26 +114,21 @@ class PrefService : public base::NonThreadSafe, |
DISALLOW_COPY_AND_ASSIGN(Preference); |
}; |
- // JsonPrefStore::Delegate implementaion. |
- virtual void OnPrefsRead(PersistentPrefStore::PrefReadError error, |
- bool no_dir); |
- |
// 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. |extension_pref_store| is used as the source for |
// extension-controlled preferences and may be NULL. The PrefService takes |
- // ownership of |extension_pref_store|. |
+ // ownership of |extension_pref_store|. If |async| is true, asynchronous |
+ // version is used. Notifies using PREF_INITIALIZATION_COMPLETED in the end. |
+ // Details is set to the created PrefService or NULL if creation has failed. |
+ // Note, it is guaranteed that in asynchronous version initialization happens |
+ // after this function returned. |
static PrefService* CreatePrefService(const FilePath& pref_filename, |
PrefStore* extension_pref_store, |
- Profile* profile); |
- |
- // Same as above, but with async initialization. |
- static PrefService* CreatePrefServiceAsync(const FilePath& pref_filename, |
- PrefStore* extension_pref_store, |
- Profile* profile, |
- PrefServiceDelegate* delegate); |
+ Profile* profile, |
+ bool async); |
// Creates an incognito copy of the pref service that shares most pref stores |
// but uses a fresh non-persistent overlay for the user pref store and an |
@@ -258,7 +247,7 @@ class PrefService : public base::NonThreadSafe, |
PrefStore* recommended_platform_prefs, |
PrefStore* recommended_cloud_prefs, |
DefaultPrefStore* default_store, |
- PrefServiceDelegate* delegate); |
+ bool async); |
// The PrefNotifier handles registering and notifying preference observers. |
// It is created and owned by this PrefService. Subclasses may access it for |
@@ -316,7 +305,7 @@ class PrefService : public base::NonThreadSafe, |
// Load preferences from storage, attempting to diagnose and handle errors. |
// This should only be called from the constructor. |
- void InitFromStorage(); |
+ void InitFromStorage(bool async); |
// Used to set the value of dictionary or list values in the user pref store. |
// This will create a dictionary or list if one does not exist in the user |
@@ -340,10 +329,6 @@ class PrefService : public base::NonThreadSafe, |
// of registered preferences are. |
mutable PreferenceSet prefs_; |
- // Holds delegator to be called after initialization, if async version |
- // is used. |
- PrefServiceDelegate* delegate_; |
- |
DISALLOW_COPY_AND_ASSIGN(PrefService); |
}; |