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/sync/profile_sync_service_android.h" | 5 #include "chrome/browser/sync/profile_sync_service_android.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 return base::android::ConvertUTF16ToJavaString(env, | 434 return base::android::ConvertUTF16ToJavaString(env, |
435 l10n_util::GetStringFUTF16(IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE, | 435 l10n_util::GetStringFUTF16(IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE, |
436 passphrase_time_str)); | 436 passphrase_time_str)); |
437 } | 437 } |
438 | 438 |
439 ScopedJavaLocalRef<jstring> | 439 ScopedJavaLocalRef<jstring> |
440 ProfileSyncServiceAndroid::GetCurrentSignedInAccountText( | 440 ProfileSyncServiceAndroid::GetCurrentSignedInAccountText( |
441 JNIEnv* env, | 441 JNIEnv* env, |
442 const JavaParamRef<jobject>&) { | 442 const JavaParamRef<jobject>&) { |
443 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 443 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
444 // TODO(maxbogue): Remove this function. This String can be used in Java. | 444 const std::string& sync_username = |
445 return base::android::ConvertUTF16ToJavaString(env, | 445 SigninManagerFactory::GetForProfile(profile_) |
446 l10n_util::GetStringUTF16(IDS_SYNC_ACCOUNT_SYNCING)); | 446 ->GetAuthenticatedAccountInfo() |
| 447 .email; |
| 448 return base::android::ConvertUTF16ToJavaString( |
| 449 env, l10n_util::GetStringFUTF16(IDS_SYNC_ACCOUNT_INFO, |
| 450 base::ASCIIToUTF16(sync_username))); |
447 } | 451 } |
448 | 452 |
449 ScopedJavaLocalRef<jstring> | 453 ScopedJavaLocalRef<jstring> |
450 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText( | 454 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText( |
451 JNIEnv* env, | 455 JNIEnv* env, |
452 const JavaParamRef<jobject>&) { | 456 const JavaParamRef<jobject>&) { |
453 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 457 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
454 return ConvertUTF8ToJavaString( | 458 return ConvertUTF8ToJavaString( |
455 env, l10n_util::GetStringUTF8(IDS_SYNC_ENTER_PASSPHRASE_BODY)); | 459 env, l10n_util::GetStringUTF8(IDS_SYNC_ENTER_PASSPHRASE_BODY)); |
456 } | 460 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 511 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
508 ProfileSyncServiceAndroid* profile_sync_service_android = | 512 ProfileSyncServiceAndroid* profile_sync_service_android = |
509 new ProfileSyncServiceAndroid(env, obj); | 513 new ProfileSyncServiceAndroid(env, obj); |
510 if (profile_sync_service_android->Init()) { | 514 if (profile_sync_service_android->Init()) { |
511 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 515 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
512 } else { | 516 } else { |
513 delete profile_sync_service_android; | 517 delete profile_sync_service_android; |
514 return 0; | 518 return 0; |
515 } | 519 } |
516 } | 520 } |
OLD | NEW |