Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3174)

Unified Diff: chrome/browser/prefs/pref_service_builder.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/pref_service_builder.h ('k') | chrome/browser/prefs/pref_service_mock_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c1880b1db657d6515ec89f65c864ce8ff96287c6 100644
--- a/chrome/browser/prefs/pref_service_builder.cc
+++ b/chrome/browser/prefs/pref_service_builder.cc
@@ -9,6 +9,7 @@
#include "base/prefs/json_pref_store.h"
#include "chrome/browser/prefs/pref_notifier_impl.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/prefs/pref_service_simple.h"
#include "chrome/browser/prefs/pref_value_store.h"
namespace {
@@ -19,8 +20,7 @@ void DoNothingHandleReadError(PersistentPrefStore::PrefReadError error) {
} // namespace
-PrefServiceBuilder::PrefServiceBuilder()
- : sync_associator_(NULL) {
+PrefServiceBuilder::PrefServiceBuilder() {
ResetDefaultState();
}
@@ -53,12 +53,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 +72,33 @@ PrefServiceBuilder& PrefServiceBuilder::WithAsync(bool async) {
return *this;
}
-PrefService* PrefServiceBuilder::Create() {
+PrefServiceSimple* PrefServiceBuilder::CreateSimple() {
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),
+ PrefServiceSimple* pref_service = new PrefServiceSimple(
+ 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;
}
« no previous file with comments | « chrome/browser/prefs/pref_service_builder.h ('k') | chrome/browser/prefs/pref_service_mock_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698