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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2740493002: Pref service: create service at browser startup (Closed)
Patch Set: Address sammc's review comments 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
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 4c471bea5ad13cdb186f88e59fc9d118a5703e1f..36005c93b252745c7d1626b36b0bc72cdcee1f46 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -196,6 +196,7 @@
#include "ppapi/host/ppapi_host.h"
#include "printing/features/features.h"
#include "services/image_decoder/public/interfaces/constants.mojom.h"
+#include "services/preferences/public/cpp/pref_store_manager_impl.h"
#include "services/preferences/public/interfaces/preferences.mojom.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "services/service_manager/public/cpp/interface_registry.h"
@@ -3236,6 +3237,20 @@ void ChromeContentBrowserClient::RegisterInProcessServices(
#endif // OS_CHROMEOS
}
+void ChromeContentBrowserClient::RegisterInProcessServices(
+ content::BrowserContext* browser_context,
+ StaticServiceMap* services) {
+ if (base::FeatureList::IsEnabled(features::kPrefService)) {
+ content::ServiceInfo info;
+ info.factory = base::Bind([] {
+ return std::unique_ptr<service_manager::Service>(
+ base::MakeUnique<prefs::PrefStoreManagerImpl>(
Bernhard Bauer 2017/03/07 09:43:16 It's a bit strange to construct a unique_ptr from
tibell 2017/03/08 00:05:52 Done.
+ prefs::PrefStoreManagerImpl::PrefStoreTypes()));
+ });
+ services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info));
+ }
+}
+
void ChromeContentBrowserClient::RegisterOutOfProcessServices(
OutOfProcessServiceMap* services) {
#if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)

Powered by Google App Engine
This is Rietveld 408576698