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. |