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

Unified Diff: chrome/browser/sync/profile_sync_service_factory.cc

Issue 2948603002: [Sync] Get SyncServce instead of ProfileSyncService. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | chrome/browser/ui/webui/sync_internals_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_factory.cc
diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc
index 957603e0707bf102c6f46a237bb5ec3aadf7eccf..f066d65c86ba709a8dfe60ff516dc6bf72fc5cfb 100644
--- a/chrome/browser/sync/profile_sync_service_factory.cc
+++ b/chrome/browser/sync/profile_sync_service_factory.cc
@@ -103,17 +103,19 @@ ProfileSyncServiceFactory* ProfileSyncServiceFactory::GetInstance() {
// static
ProfileSyncService* ProfileSyncServiceFactory::GetForProfile(
Profile* profile) {
- if (!ProfileSyncService::IsSyncAllowedByFlag())
- return nullptr;
-
return static_cast<ProfileSyncService*>(
- GetInstance()->GetServiceForBrowserContext(profile, true));
+ GetSyncServiceForBrowserContext(profile));
}
// static
syncer::SyncService* ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(
content::BrowserContext* context) {
- return GetForProfile(Profile::FromBrowserContext(context));
+ if (!ProfileSyncService::IsSyncAllowedByFlag()) {
+ return nullptr;
+ }
+
+ return static_cast<syncer::SyncService*>(
+ GetInstance()->GetServiceForBrowserContext(context, true));
}
ProfileSyncServiceFactory::ProfileSyncServiceFactory()
« no previous file with comments | « no previous file | chrome/browser/ui/webui/sync_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698