| Index: chrome/browser/android/signin/signin_manager_android.cc
|
| diff --git a/chrome/browser/android/signin/signin_manager_android.cc b/chrome/browser/android/signin/signin_manager_android.cc
|
| index 8cd2b7e6890d7a48f443e8e013e8626ade2e92c9..faf0e6f85ceeef9bacd1804b2be0580397ff76ef 100644
|
| --- a/chrome/browser/android/signin/signin_manager_android.cc
|
| +++ b/chrome/browser/android/signin/signin_manager_android.cc
|
| @@ -17,7 +17,10 @@
|
| #include "chrome/browser/browsing_data/browsing_data_helper.h"
|
| #include "chrome/browser/browsing_data/browsing_data_remover.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| +#include "chrome/browser/profiles/profiles_state.h"
|
| #include "chrome/browser/signin/google_auto_login_helper.h"
|
| +#include "chrome/browser/signin/profile_oauth2_token_service.h"
|
| +#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
|
| #include "chrome/browser/signin/signin_manager.h"
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -205,9 +208,25 @@ void SigninManagerAndroid::OnBrowsingDataRemoverDone() {
|
| }
|
|
|
| void SigninManagerAndroid::LogInSignedInUser(JNIEnv* env, jobject obj) {
|
| - // AutoLogin deletes itself.
|
| - GoogleAutoLoginHelper* autoLogin = new GoogleAutoLoginHelper(profile_);
|
| - autoLogin->LogIn();
|
| + if (profiles::IsNewProfileManagementEnabled()) {
|
| + // New Mirror code path that just fires the events and let the
|
| + // Account Reconcilor handles everything.
|
| + AndroidProfileOAuth2TokenService* token_service =
|
| + ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
|
| + const std::string& primary_acct = token_service->GetPrimaryAccountId();
|
| + const std::vector<std::string>& ids = token_service->GetAccounts();
|
| + token_service->ValidateAccounts(primary_acct, ids);
|
| +
|
| + } else {
|
| + DVLOG(1) << "SigninManagerAndroid::LogInSignedInUser "
|
| + " Manually calling GoogleAutoLoginHelper";
|
| + // Old code path that doesn't depend on the new Account Reconcilor.
|
| + // We manually login.
|
| +
|
| + // AutoLogin deletes itself.
|
| + GoogleAutoLoginHelper* autoLogin = new GoogleAutoLoginHelper(profile_);
|
| + autoLogin->LogIn();
|
| + }
|
| }
|
|
|
| static jlong Init(JNIEnv* env, jobject obj) {
|
|
|