Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index cce1253528ea7d313cd6b756e0f0a9cec4a064e5..8cf0d1b3e925b3959278ab4cf7185264b9a30f5a 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -118,6 +118,8 @@ |
#include "extensions/features/features.h" |
#include "ppapi/features/features.h" |
#include "printing/features/features.h" |
+#include "services/identity/identity_service.h" |
+#include "services/identity/public/interfaces/constants.mojom.h" |
#include "services/preferences/public/cpp/pref_service_main.h" |
#include "services/preferences/public/interfaces/preferences.mojom.h" |
#include "services/preferences/public/interfaces/tracked_preference_validation_delegate.mojom.h" |
@@ -1075,6 +1077,19 @@ void ProfileImpl::RegisterInProcessServices(StaticServiceMap* services) { |
content::BrowserThread::IO); |
services->insert(std::make_pair(prefs::mojom::kPrefStoreServiceName, info)); |
} |
+ |
+ content::ServiceInfo identity_service_info; |
+ |
+ // The Identity Service must run on the UI thread. |
+ identity_service_info.task_runner = base::ThreadTaskRunnerHandle::Get(); |
+ |
+ // NOTE: The dependencies of the Identity Service have not yet been created, |
+ // so it is not possible to bind them here. Instead, bind them at the time |
+ // of the actual request to create the Identity Service. |
+ identity_service_info.factory = |
+ base::Bind(&ProfileImpl::CreateIdentityService, base::Unretained(this)); |
+ services->insert( |
+ std::make_pair(identity::mojom::kServiceName, identity_service_info)); |
} |
bool ProfileImpl::IsSameProfile(Profile* profile) { |
@@ -1333,3 +1348,8 @@ ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
return service->CreateMonitor( |
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
} |
+ |
+std::unique_ptr<service_manager::Service> ProfileImpl::CreateIdentityService() { |
+ SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(this); |
+ return base::MakeUnique<identity::IdentityService>(signin_manager); |
+} |