| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 } | 460 } |
| 461 | 461 |
| 462 // Functionality only available for testing purposes. | 462 // Functionality only available for testing purposes. |
| 463 | 463 |
| 464 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest( | 464 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::GetAboutInfoForTest( |
| 465 JNIEnv* env, | 465 JNIEnv* env, |
| 466 const JavaParamRef<jobject>&) { | 466 const JavaParamRef<jobject>&) { |
| 467 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 467 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 468 | 468 |
| 469 std::unique_ptr<base::DictionaryValue> about_info = | 469 std::unique_ptr<base::DictionaryValue> about_info = |
| 470 syncer::sync_ui_util::ConstructAboutInformation( | 470 syncer::sync_ui_util::ConstructAboutInformation(sync_service_, |
| 471 sync_service_, sync_service_->signin(), chrome::GetChannel()); | 471 chrome::GetChannel()); |
| 472 std::string about_info_json; | 472 std::string about_info_json; |
| 473 base::JSONWriter::Write(*about_info, &about_info_json); | 473 base::JSONWriter::Write(*about_info, &about_info_json); |
| 474 | 474 |
| 475 return ConvertUTF8ToJavaString(env, about_info_json); | 475 return ConvertUTF8ToJavaString(env, about_info_json); |
| 476 } | 476 } |
| 477 | 477 |
| 478 jlong ProfileSyncServiceAndroid::GetLastSyncedTimeForTest( | 478 jlong ProfileSyncServiceAndroid::GetLastSyncedTimeForTest( |
| 479 JNIEnv* env, | 479 JNIEnv* env, |
| 480 const JavaParamRef<jobject>& obj) { | 480 const JavaParamRef<jobject>& obj) { |
| 481 // Use profile preferences here instead of SyncPrefs to avoid an extra | 481 // Use profile preferences here instead of SyncPrefs to avoid an extra |
| (...skipping 29 matching lines...) Expand all Loading... |
| 511 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 511 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 512 ProfileSyncServiceAndroid* profile_sync_service_android = | 512 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 513 new ProfileSyncServiceAndroid(env, obj); | 513 new ProfileSyncServiceAndroid(env, obj); |
| 514 if (profile_sync_service_android->Init()) { | 514 if (profile_sync_service_android->Init()) { |
| 515 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 515 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
| 516 } else { | 516 } else { |
| 517 delete profile_sync_service_android; | 517 delete profile_sync_service_android; |
| 518 return 0; | 518 return 0; |
| 519 } | 519 } |
| 520 } | 520 } |
| OLD | NEW |