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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments, use pure builder pattern. 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
Index: chrome/browser/prefs/pref_service_builder.h
diff --git a/chrome/browser/prefs/pref_service_builder.h b/chrome/browser/prefs/pref_service_builder.h
index 3c64d0dc6eb1118c262b97d4d82aeb6285c07c0a..639915b8cf1d1ec0c3dba5fe259e02f6dc482576 100644
--- a/chrome/browser/prefs/pref_service_builder.h
+++ b/chrome/browser/prefs/pref_service_builder.h
@@ -12,14 +12,13 @@
#include "base/prefs/pref_store.h"
class FilePath;
-class PrefModelAssociator;
-class PrefService;
+class PrefServiceSimple;
namespace base {
class SequencedTaskRunner;
}
-// A class that allows convenient building of custom PrefServices.
+// A class that allows convenient building of PrefService.
class PrefServiceBuilder {
public:
PrefServiceBuilder();
@@ -33,9 +32,6 @@ class PrefServiceBuilder {
PrefServiceBuilder& WithUserPrefs(PersistentPrefStore* store);
PrefServiceBuilder& WithRecommendedPrefs(PrefStore* store);
- // Takes ownership of the associator.
- PrefServiceBuilder& WithSyncAssociator(PrefModelAssociator* associator);
-
// Sets up error callback for the PrefService. A do-nothing default
// is provided if this is not called.
PrefServiceBuilder& WithReadErrorCallback(
@@ -49,28 +45,25 @@ class PrefServiceBuilder {
PrefServiceBuilder& WithAsync(bool async);
- // Creates the PrefService, invalidating the entire builder configuration.
- virtual PrefService* Create();
+ // Creates a PrefServiceSimple object initialized with the
+ // parameters from this builder.
+ virtual PrefServiceSimple* CreateSimple();
protected:
+ void ResetDefaultState();
+
scoped_refptr<PrefStore> managed_prefs_;
scoped_refptr<PrefStore> extension_prefs_;
scoped_refptr<PrefStore> command_line_prefs_;
scoped_refptr<PersistentPrefStore> user_prefs_;
scoped_refptr<PrefStore> recommended_prefs_;
- // TODO(joi): Would be nice to switch the various places that deal
- // with this pointer to using scoped_ptr::Pass semantics.
- PrefModelAssociator* sync_associator_;
-
base::Callback<void(PersistentPrefStore::PrefReadError)> read_error_callback_;
// Defaults to false.
bool async_;
private:
- void ResetDefaultState();
-
DISALLOW_COPY_AND_ASSIGN(PrefServiceBuilder);
};

Powered by Google App Engine
This is Rietveld 408576698