| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/signin/signin_manager_android.h" | 5 #include "chrome/browser/android/signin/signin_manager_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 void SigninManagerAndroid::LogInSignedInUser(JNIEnv* env, jobject obj) { | 233 void SigninManagerAndroid::LogInSignedInUser(JNIEnv* env, jobject obj) { |
| 234 SigninManagerBase* signin_manager = | 234 SigninManagerBase* signin_manager = |
| 235 SigninManagerFactory::GetForProfile(profile_); | 235 SigninManagerFactory::GetForProfile(profile_); |
| 236 if (switches::IsNewProfileManagement()) { | 236 if (switches::IsNewProfileManagement()) { |
| 237 // New Mirror code path that just fires the events and let the | 237 // New Mirror code path that just fires the events and let the |
| 238 // Account Reconcilor handles everything. | 238 // Account Reconcilor handles everything. |
| 239 AndroidProfileOAuth2TokenService* token_service = | 239 AndroidProfileOAuth2TokenService* token_service = |
| 240 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( | 240 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( |
| 241 profile_); | 241 profile_); |
| 242 const std::string& primary_acct = | 242 std::string primary_acct = signin_manager->GetAuthenticatedAccountId(); |
| 243 signin_manager->GetAuthenticatedAccountId(); | |
| 244 token_service->ValidateAccounts(primary_acct, true); | 243 token_service->ValidateAccounts(primary_acct, true); |
| 245 | 244 |
| 246 } else { | 245 } else { |
| 247 DVLOG(1) << "SigninManagerAndroid::LogInSignedInUser " | 246 DVLOG(1) << "SigninManagerAndroid::LogInSignedInUser " |
| 248 " Manually calling MergeSessionHelper"; | 247 " Manually calling MergeSessionHelper"; |
| 249 // Old code path that doesn't depend on the new Account Reconcilor. | 248 // Old code path that doesn't depend on the new Account Reconcilor. |
| 250 // We manually login. | 249 // We manually login. |
| 251 | 250 |
| 252 ProfileOAuth2TokenService* token_service = | 251 ProfileOAuth2TokenService* token_service = |
| 253 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 252 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 287 } |
| 289 | 288 |
| 290 static jboolean IsNewProfileManagementEnabled(JNIEnv* env, jclass clazz) { | 289 static jboolean IsNewProfileManagementEnabled(JNIEnv* env, jclass clazz) { |
| 291 return switches::IsNewProfileManagement(); | 290 return switches::IsNewProfileManagement(); |
| 292 } | 291 } |
| 293 | 292 |
| 294 // static | 293 // static |
| 295 bool SigninManagerAndroid::Register(JNIEnv* env) { | 294 bool SigninManagerAndroid::Register(JNIEnv* env) { |
| 296 return RegisterNativesImpl(env); | 295 return RegisterNativesImpl(env); |
| 297 } | 296 } |
| OLD | NEW |