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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 SigninManagerBase* signin_manager = | 218 SigninManagerBase* signin_manager = |
219 SigninManagerFactory::GetForProfile(profile_); | 219 SigninManagerFactory::GetForProfile(profile_); |
220 if (switches::IsNewProfileManagement()) { | 220 if (switches::IsNewProfileManagement()) { |
221 // New Mirror code path that just fires the events and let the | 221 // New Mirror code path that just fires the events and let the |
222 // Account Reconcilor handles everything. | 222 // Account Reconcilor handles everything. |
223 AndroidProfileOAuth2TokenService* token_service = | 223 AndroidProfileOAuth2TokenService* token_service = |
224 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( | 224 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( |
225 profile_); | 225 profile_); |
226 const std::string& primary_acct = | 226 const std::string& primary_acct = |
227 signin_manager->GetAuthenticatedAccountId(); | 227 signin_manager->GetAuthenticatedAccountId(); |
228 const std::vector<std::string>& ids = token_service->GetAccounts(); | 228 token_service->ValidateAccounts(primary_acct); |
229 token_service->ValidateAccounts(primary_acct, ids); | |
230 | 229 |
231 } else { | 230 } else { |
232 DVLOG(1) << "SigninManagerAndroid::LogInSignedInUser " | 231 DVLOG(1) << "SigninManagerAndroid::LogInSignedInUser " |
233 " Manually calling MergeSessionHelper"; | 232 " Manually calling MergeSessionHelper"; |
234 // Old code path that doesn't depend on the new Account Reconcilor. | 233 // Old code path that doesn't depend on the new Account Reconcilor. |
235 // We manually login. | 234 // We manually login. |
236 | 235 |
237 ProfileOAuth2TokenService* token_service = | 236 ProfileOAuth2TokenService* token_service = |
238 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 237 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
239 merge_session_helper_.reset(new MergeSessionHelper( | 238 merge_session_helper_.reset(new MergeSessionHelper( |
(...skipping 21 matching lines...) Expand all Loading... |
261 } | 260 } |
262 | 261 |
263 static jboolean IsNewProfileManagementEnabled(JNIEnv* env, jclass clazz) { | 262 static jboolean IsNewProfileManagementEnabled(JNIEnv* env, jclass clazz) { |
264 return switches::IsNewProfileManagement(); | 263 return switches::IsNewProfileManagement(); |
265 } | 264 } |
266 | 265 |
267 // static | 266 // static |
268 bool SigninManagerAndroid::Register(JNIEnv* env) { | 267 bool SigninManagerAndroid::Register(JNIEnv* env) { |
269 return RegisterNativesImpl(env); | 268 return RegisterNativesImpl(env); |
270 } | 269 } |
OLD | NEW |