Index: chrome/browser/prefs/pref_service_builder.cc |
diff --git a/chrome/browser/prefs/pref_service_builder.cc b/chrome/browser/prefs/pref_service_builder.cc |
index f73f2f1580a65bae2bc8511d086e805dda540054..a254c7e9fc72295ce25e87528c29ef88e4649816 100644 |
--- a/chrome/browser/prefs/pref_service_builder.cc |
+++ b/chrome/browser/prefs/pref_service_builder.cc |
@@ -19,8 +19,7 @@ void DoNothingHandleReadError(PersistentPrefStore::PrefReadError error) { |
} // namespace |
-PrefServiceBuilder::PrefServiceBuilder() |
- : sync_associator_(NULL) { |
+PrefServiceBuilder::PrefServiceBuilder() { |
ResetDefaultState(); |
} |
@@ -53,12 +52,6 @@ PrefServiceBuilder& PrefServiceBuilder::WithRecommendedPrefs(PrefStore* store) { |
return *this; |
} |
-PrefServiceBuilder& PrefServiceBuilder::WithSyncAssociator( |
- PrefModelAssociator* associator) { |
- sync_associator_ = associator; |
- return *this; |
-} |
- |
PrefServiceBuilder& PrefServiceBuilder::WithReadErrorCallback( |
const base::Callback<void(PersistentPrefStore::PrefReadError)>& |
read_error_callback) { |
@@ -78,38 +71,33 @@ PrefServiceBuilder& PrefServiceBuilder::WithAsync(bool async) { |
return *this; |
} |
-PrefService* PrefServiceBuilder::Create() { |
+PrefService* PrefServiceBuilder::Build(PrefService* pref_service) { |
DefaultPrefStore* default_pref_store = new DefaultPrefStore(); |
PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); |
- PrefService* pref_service = |
- new PrefService( |
- pref_notifier, |
- new PrefValueStore( |
- managed_prefs_.get(), |
- extension_prefs_.get(), |
- command_line_prefs_.get(), |
- user_prefs_.get(), |
- recommended_prefs_.get(), |
- default_pref_store, |
- sync_associator_, |
- pref_notifier), |
+ pref_service->Initialize( |
+ pref_notifier, |
+ new PrefValueStore( |
+ managed_prefs_.get(), |
+ extension_prefs_.get(), |
+ command_line_prefs_.get(), |
user_prefs_.get(), |
+ recommended_prefs_.get(), |
default_pref_store, |
- sync_associator_, |
- read_error_callback_, |
- async_); |
- managed_prefs_ = NULL; |
- extension_prefs_ = NULL; |
- command_line_prefs_ = NULL; |
- user_prefs_ = NULL; |
- recommended_prefs_ = NULL; |
- sync_associator_ = NULL; |
+ pref_notifier), |
+ user_prefs_.get(), |
+ default_pref_store, |
+ read_error_callback_, |
+ async_); |
ResetDefaultState(); |
- |
return pref_service; |
} |
void PrefServiceBuilder::ResetDefaultState() { |
+ managed_prefs_ = NULL; |
+ extension_prefs_ = NULL; |
+ command_line_prefs_ = NULL; |
+ user_prefs_ = NULL; |
+ recommended_prefs_ = NULL; |
read_error_callback_ = base::Bind(&DoNothingHandleReadError); |
async_ = false; |
} |