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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 void SigninManagerAndroid::MergeSessionCompleted( | 225 void SigninManagerAndroid::MergeSessionCompleted( |
226 const std::string& account_id, | 226 const std::string& account_id, |
227 const GoogleServiceAuthError& error) { | 227 const GoogleServiceAuthError& error) { |
228 merge_session_helper_->RemoveObserver(this); | 228 merge_session_helper_->RemoveObserver(this); |
229 merge_session_helper_.reset(); | 229 merge_session_helper_.reset(); |
230 } | 230 } |
231 | 231 |
232 void SigninManagerAndroid::LogInSignedInUser(JNIEnv* env, jobject obj) { | 232 void SigninManagerAndroid::LogInSignedInUser(JNIEnv* env, jobject obj) { |
233 SigninManagerBase* signin_manager = | 233 SigninManagerBase* signin_manager = |
234 SigninManagerFactory::GetForProfile(profile_); | 234 SigninManagerFactory::GetForProfile(profile_); |
235 if (switches::IsNewProfileManagement()) { | 235 if (switches::IsEnableAccountConsistency()) { |
236 // New Mirror code path that just fires the events and let the | 236 // New Mirror code path that just fires the events and let the |
237 // Account Reconcilor handles everything. | 237 // Account Reconcilor handles everything. |
238 AndroidProfileOAuth2TokenService* token_service = | 238 AndroidProfileOAuth2TokenService* token_service = |
239 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( | 239 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( |
240 profile_); | 240 profile_); |
241 const std::string& primary_acct = | 241 const std::string& primary_acct = |
242 signin_manager->GetAuthenticatedAccountId(); | 242 signin_manager->GetAuthenticatedAccountId(); |
243 token_service->ValidateAccounts(primary_acct, true); | 243 token_service->ValidateAccounts(primary_acct, true); |
244 | 244 |
245 } else { | 245 } else { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 #if defined(ENABLE_CONFIGURATION_POLICY) | 279 #if defined(ENABLE_CONFIGURATION_POLICY) |
280 std::string username = | 280 std::string username = |
281 base::android::ConvertJavaStringToUTF8(env, j_username); | 281 base::android::ConvertJavaStringToUTF8(env, j_username); |
282 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); | 282 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); |
283 #else | 283 #else |
284 return false; | 284 return false; |
285 #endif | 285 #endif |
286 } | 286 } |
287 | 287 |
288 static jboolean IsNewProfileManagementEnabled(JNIEnv* env, jclass clazz) { | 288 static jboolean IsNewProfileManagementEnabled(JNIEnv* env, jclass clazz) { |
289 return switches::IsNewProfileManagement(); | 289 return switches::IsEnableAccountConsistency(); |
aruslan
2014/08/18 21:25:21
This is a deadly way of dealing with flags.
It is
Mike Lerman
2014/08/19 14:59:07
I don't see a IsNewProfileManagementEnabled flag,
| |
290 } | 290 } |
291 | 291 |
292 // static | 292 // static |
293 bool SigninManagerAndroid::Register(JNIEnv* env) { | 293 bool SigninManagerAndroid::Register(JNIEnv* env) { |
294 return RegisterNativesImpl(env); | 294 return RegisterNativesImpl(env); |
295 } | 295 } |
OLD | NEW |