Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: chrome/browser/sync/profile_sync_service_android.cc

Issue 2898723003: [Sync] Migrate SyncInternalsMessageHandler off CallJavascriptFunctionUnsafe. (Closed)
Patch Set: More updates for dbeam. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698