From ae74d735cf273eb9c21572d0b5cfa51b6bc4b3eb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 8 Sep 2016 13:35:15 -0700 Subject: [PATCH] Create a PrefServiceSyncable as required by Chrome (issue #1947) --- libcef/browser/prefs/browser_prefs.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 5b6dd85b3..386c5ff4e 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -28,12 +28,13 @@ #include "components/prefs/pref_filter.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" -#include "components/prefs/pref_service_factory.h" #include "components/prefs/testing_pref_store.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/proxy_config_dictionary.h" #include "components/spellcheck/browser/pref_names.h" +#include "components/syncable_prefs/pref_service_syncable.h" +#include "components/syncable_prefs/pref_service_syncable_factory.h" #include "components/update_client/update_client.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_prefs.h" @@ -99,7 +100,9 @@ std::unique_ptr CreatePrefService( const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - PrefServiceFactory factory; + // Use of PrefServiceSyncable is required by Chrome code such as + // HostContentSettingsMapFactory that calls PrefServiceSyncableFromProfile. + syncable_prefs::PrefServiceSyncableFactory factory; // Used to store command-line preferences, most of which will be evaluated in // the CommandLinePrefStore constructor. Preferences set in this manner cannot @@ -231,7 +234,7 @@ std::unique_ptr CreatePrefService( } // Build the PrefService that manages the PrefRegistry and PrefStores. - return factory.Create(registry.get()); + return factory.CreateSyncable(registry.get()); } } // namespace browser_prefs