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

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

Issue 12310042: Do not initialize sync or policy on import process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 7 years, 10 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/policy/user_policy_signin_service.cc ('k') | chrome/browser/webdata/web_data_service.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 0000819ae3071e545f6a2077013ed42140c1c1c3..79e0888a2640bd206da011252c705605c17b0233 100644
--- a/chrome/browser/sync/profile_sync_service_factory.cc
+++ b/chrome/browser/sync/profile_sync_service_factory.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_dependency_manager.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/signin/about_signin_internals_factory.h"
@@ -38,6 +39,10 @@ ProfileSyncService* ProfileSyncServiceFactory::GetForProfile(
if (!ProfileSyncService::IsSyncEnabled())
return NULL;
+ // Do not start sync on the import process.
+ if (ProfileManager::IsImportProcess(*CommandLine::ForCurrentProcess()))
+ return NULL;
+
return static_cast<ProfileSyncService*>(
GetInstance()->GetServiceForProfile(profile, true));
}
« no previous file with comments | « chrome/browser/policy/user_policy_signin_service.cc ('k') | chrome/browser/webdata/web_data_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698