| 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 "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/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 base::TimeFormatShortDate(passphrase_time); | 274 base::TimeFormatShortDate(passphrase_time); |
| 275 return base::android::ConvertUTF16ToJavaString(env, | 275 return base::android::ConvertUTF16ToJavaString(env, |
| 276 l10n_util::GetStringFUTF16(IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE, | 276 l10n_util::GetStringFUTF16(IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE, |
| 277 passphrase_time_str)); | 277 passphrase_time_str)); |
| 278 } | 278 } |
| 279 | 279 |
| 280 ScopedJavaLocalRef<jstring> | 280 ScopedJavaLocalRef<jstring> |
| 281 ProfileSyncServiceAndroid::GetCurrentSignedInAccountText( | 281 ProfileSyncServiceAndroid::GetCurrentSignedInAccountText( |
| 282 JNIEnv* env, jobject) { | 282 JNIEnv* env, jobject) { |
| 283 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 283 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 284 const std::string& sync_username = | 284 std::string sync_username = |
| 285 SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername(); | 285 SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername(); |
| 286 return base::android::ConvertUTF16ToJavaString(env, | 286 return base::android::ConvertUTF16ToJavaString(env, |
| 287 l10n_util::GetStringFUTF16( | 287 l10n_util::GetStringFUTF16( |
| 288 IDS_SYNC_ACCOUNT_SYNCING_TO_USER, | 288 IDS_SYNC_ACCOUNT_SYNCING_TO_USER, |
| 289 base::ASCIIToUTF16(sync_username))); | 289 base::ASCIIToUTF16(sync_username))); |
| 290 } | 290 } |
| 291 | 291 |
| 292 ScopedJavaLocalRef<jstring> | 292 ScopedJavaLocalRef<jstring> |
| 293 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText( | 293 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText( |
| 294 JNIEnv* env, jobject) { | 294 JNIEnv* env, jobject) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 ProfileSyncServiceAndroid* profile_sync_service_android = | 476 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 477 new ProfileSyncServiceAndroid(env, obj); | 477 new ProfileSyncServiceAndroid(env, obj); |
| 478 profile_sync_service_android->Init(); | 478 profile_sync_service_android->Init(); |
| 479 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 479 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
| 480 } | 480 } |
| 481 | 481 |
| 482 // static | 482 // static |
| 483 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 483 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
| 484 return RegisterNativesImpl(env); | 484 return RegisterNativesImpl(env); |
| 485 } | 485 } |
| OLD | NEW |