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_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 JNIEnv* env, jobject) { | 382 JNIEnv* env, jobject) { |
383 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 383 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
384 return sync_service_->HasUnrecoverableError(); | 384 return sync_service_->HasUnrecoverableError(); |
385 } | 385 } |
386 | 386 |
387 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest( | 387 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest( |
388 JNIEnv* env, jobject) { | 388 JNIEnv* env, jobject) { |
389 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 389 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
390 | 390 |
391 scoped_ptr<base::DictionaryValue> about_info = | 391 scoped_ptr<base::DictionaryValue> about_info = |
392 sync_ui_util::ConstructAboutInformation(sync_service_, | 392 sync_driver::ConstructAboutInformation( |
393 sync_service_->signin(), | 393 sync_service_, sync_service_->signin(), chrome::GetChannel()); |
394 chrome::GetChannel()); | |
395 std::string about_info_json; | 394 std::string about_info_json; |
396 base::JSONWriter::Write(*about_info, &about_info_json); | 395 base::JSONWriter::Write(*about_info, &about_info_json); |
397 | 396 |
398 return ConvertUTF8ToJavaString(env, about_info_json); | 397 return ConvertUTF8ToJavaString(env, about_info_json); |
399 } | 398 } |
400 | 399 |
401 jlong ProfileSyncServiceAndroid::GetLastSyncedTimeForTest( | 400 jlong ProfileSyncServiceAndroid::GetLastSyncedTimeForTest( |
402 JNIEnv* env, jobject obj) { | 401 JNIEnv* env, jobject obj) { |
403 // Use profile preferences here instead of SyncPrefs to avoid an extra | 402 // Use profile preferences here instead of SyncPrefs to avoid an extra |
404 // conversion, since SyncPrefs::GetLastSyncedTime() converts the stored value | 403 // conversion, since SyncPrefs::GetLastSyncedTime() converts the stored value |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 ProfileSyncServiceAndroid* profile_sync_service_android = | 440 ProfileSyncServiceAndroid* profile_sync_service_android = |
442 new ProfileSyncServiceAndroid(env, obj); | 441 new ProfileSyncServiceAndroid(env, obj); |
443 profile_sync_service_android->Init(); | 442 profile_sync_service_android->Init(); |
444 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 443 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
445 } | 444 } |
446 | 445 |
447 // static | 446 // static |
448 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 447 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
449 return RegisterNativesImpl(env); | 448 return RegisterNativesImpl(env); |
450 } | 449 } |
OLD | NEW |