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

Unified Diff: components/sync_preferences/pref_service_syncable_factory.cc

Issue 2743463002: WIP: Pref service user prefs. (Closed)
Patch Set: Created 3 years, 9 months 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 | « components/sync_preferences/pref_service_syncable_factory.h ('k') | components/user_prefs/tracked/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_preferences/pref_service_syncable_factory.cc
diff --git a/components/sync_preferences/pref_service_syncable_factory.cc b/components/sync_preferences/pref_service_syncable_factory.cc
index 95a1a3441d79d432068a60222fd210c8e7227cb8..3f85e100749532eb101bcb8219bb92d894ca56fc 100644
--- a/components/sync_preferences/pref_service_syncable_factory.cc
+++ b/components/sync_preferences/pref_service_syncable_factory.cc
@@ -11,6 +11,7 @@
#include "components/prefs/pref_notifier_impl.h"
#include "components/prefs/pref_value_store.h"
#include "components/sync_preferences/pref_service_syncable.h"
+#include "services/preferences/public/cpp/persistent_pref_store_client.h"
#include "services/preferences/public/cpp/pref_store_adapter.h"
#include "services/preferences/public/interfaces/preferences.mojom.h"
#include "services/service_manager/public/cpp/connector.h"
@@ -81,6 +82,13 @@ std::unique_ptr<PrefServiceSyncable> PrefServiceSyncableFactory::CreateSyncable(
user_prefs::PrefRegistrySyncable* pref_registry,
service_manager::Connector* connector) {
TRACE_EVENT0("browser", "PrefServiceSyncableFactory::CreateSyncable");
+ if (!user_prefs_) {
+ prefs::mojom::PersistentPrefStoreConnectorPtr pref_connector;
+ connector->BindInterface(prefs::mojom::kPrefStoreServiceName,
+ &pref_connector);
+ user_prefs_ =
+ new prefs::PersistentPrefStoreClient(std::move(pref_connector));
+ }
PrefNotifierImpl* pref_notifier = new PrefNotifierImpl();
// Expose all read-only stores through the prefs service.
« no previous file with comments | « components/sync_preferences/pref_service_syncable_factory.h ('k') | components/user_prefs/tracked/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698