OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/signin/signin_tracker_factory.h" | 5 #include "chrome/browser/signin/signin_tracker_factory.h" |
6 | 6 |
7 #include "chrome/browser/signin/account_reconcilor_factory.h" | |
8 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 7 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
9 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" | 8 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" |
10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
11 #include "chrome/browser/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
12 #include "components/signin/core/common/profile_management_switches.h" | 11 #include "components/signin/core/common/profile_management_switches.h" |
13 | 12 |
14 SigninTrackerFactory::SigninTrackerFactory() {} | 13 SigninTrackerFactory::SigninTrackerFactory() {} |
15 SigninTrackerFactory::~SigninTrackerFactory() {} | 14 SigninTrackerFactory::~SigninTrackerFactory() {} |
16 | 15 |
17 // static | 16 // static |
18 scoped_ptr<SigninTracker> SigninTrackerFactory::CreateForProfile( | 17 scoped_ptr<SigninTracker> SigninTrackerFactory::CreateForProfile( |
19 Profile* profile, | 18 Profile* profile, |
20 SigninTracker::Observer* observer) { | 19 SigninTracker::Observer* observer) { |
21 // Determine whether to use the AccountReconcilor. | |
22 AccountReconcilor* account_reconcilor = NULL; | |
23 if (switches::IsEnableAccountConsistency()) | |
24 account_reconcilor = AccountReconcilorFactory::GetForProfile(profile); | |
25 | |
26 return scoped_ptr<SigninTracker>(new SigninTracker( | 20 return scoped_ptr<SigninTracker>(new SigninTracker( |
27 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 21 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
28 SigninManagerFactory::GetForProfile(profile), | 22 SigninManagerFactory::GetForProfile(profile), |
29 account_reconcilor, | |
30 GaiaCookieManagerServiceFactory::GetForProfile(profile), | 23 GaiaCookieManagerServiceFactory::GetForProfile(profile), |
31 ChromeSigninClientFactory::GetForProfile(profile), | 24 ChromeSigninClientFactory::GetForProfile(profile), |
32 observer)); | 25 observer)); |
33 } | 26 } |
OLD | NEW |