| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 ScopedJavaLocalRef<jstring> | 318 ScopedJavaLocalRef<jstring> |
| 319 ProfileSyncServiceAndroid::GetCurrentSignedInAccountText( | 319 ProfileSyncServiceAndroid::GetCurrentSignedInAccountText( |
| 320 JNIEnv* env, jobject) { | 320 JNIEnv* env, jobject) { |
| 321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 322 const std::string& sync_username = | 322 const std::string& sync_username = |
| 323 SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername(); | 323 SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername(); |
| 324 return base::android::ConvertUTF16ToJavaString(env, | 324 return base::android::ConvertUTF16ToJavaString(env, |
| 325 l10n_util::GetStringFUTF16( | 325 l10n_util::GetStringFUTF16( |
| 326 IDS_SYNC_ACCOUNT_SYNCING_TO_USER, | 326 IDS_SYNC_ACCOUNT_SYNCING_TO_USER, |
| 327 ASCIIToUTF16(sync_username))); | 327 base::ASCIIToUTF16(sync_username))); |
| 328 } | 328 } |
| 329 | 329 |
| 330 ScopedJavaLocalRef<jstring> | 330 ScopedJavaLocalRef<jstring> |
| 331 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText( | 331 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText( |
| 332 JNIEnv* env, jobject) { | 332 JNIEnv* env, jobject) { |
| 333 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 333 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 334 return ConvertUTF8ToJavaString( | 334 return ConvertUTF8ToJavaString( |
| 335 env, l10n_util::GetStringUTF8(IDS_SYNC_ENTER_PASSPHRASE_BODY)); | 335 env, l10n_util::GetStringUTF8(IDS_SYNC_ENTER_PASSPHRASE_BODY)); |
| 336 } | 336 } |
| 337 | 337 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 ProfileSyncServiceAndroid* profile_sync_service_android = | 508 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 509 new ProfileSyncServiceAndroid(env, obj); | 509 new ProfileSyncServiceAndroid(env, obj); |
| 510 profile_sync_service_android->Init(); | 510 profile_sync_service_android->Init(); |
| 511 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 511 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
| 512 } | 512 } |
| 513 | 513 |
| 514 // static | 514 // static |
| 515 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 515 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
| 516 return RegisterNativesImpl(env); | 516 return RegisterNativesImpl(env); |
| 517 } | 517 } |
| OLD | NEW |