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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 2753753007: Introduce Identity Service and its initial usage (Closed)
Patch Set: Response to reviews 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 | « chrome/browser/profiles/profile_impl.h ('k') | components/signin/public/interfaces/account_id_traits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | components/signin/public/interfaces/account_id_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698