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

Unified Diff: chrome/browser/policy/user_policy_signin_service.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 | « no previous file | chrome/browser/sync/profile_sync_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/user_policy_signin_service.cc
diff --git a/chrome/browser/policy/user_policy_signin_service.cc b/chrome/browser/policy/user_policy_signin_service.cc
index 31103278fe71d018006f29c19352ac7911421800..81896754a34cbd30384da092aeddf6a650a657fb 100644
--- a/chrome/browser/policy/user_policy_signin_service.cc
+++ b/chrome/browser/policy/user_policy_signin_service.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/policy/user_cloud_policy_manager_factory.h"
#include "chrome/browser/policy/user_info_fetcher.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/token_service.h"
@@ -227,8 +228,11 @@ void CloudPolicyClientRegistrationHelper::OnClientError(
UserPolicySigninService::UserPolicySigninService(
Profile* profile)
: profile_(profile) {
- if (profile_->GetPrefs()->GetBoolean(prefs::kDisableCloudPolicyOnSignin))
+ CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ if (profile_->GetPrefs()->GetBoolean(prefs::kDisableCloudPolicyOnSignin) ||
+ ProfileManager::IsImportProcess(*cmd_line)) {
return;
+ }
// Initialize/shutdown the UserCloudPolicyManager when the user signs out.
registrar_.Add(this,
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698