| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) { | 175 void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) { |
| 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 177 DCHECK(profile_); | 177 DCHECK(profile_); |
| 178 sync_service_->DisableForUser(); | 178 sync_service_->DisableForUser(); |
| 179 | 179 |
| 180 // Need to clear suppress start flag manually | 180 // Need to clear suppress start flag manually |
| 181 sync_prefs_->SetStartSuppressed(false); | 181 sync_prefs_->SetStartSuppressed(false); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void ProfileSyncServiceAndroid::FlushDirectory(JNIEnv* env, jobject) { |
| 185 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 186 sync_service_->FlushDirectory(); |
| 187 } |
| 188 |
| 184 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary( | 189 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary( |
| 185 JNIEnv* env, jobject) { | 190 JNIEnv* env, jobject) { |
| 186 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 187 DCHECK(profile_); | 192 DCHECK(profile_); |
| 188 std::string status(sync_service_->QuerySyncStatusSummaryString()); | 193 std::string status(sync_service_->QuerySyncStatusSummaryString()); |
| 189 return ConvertUTF8ToJavaString(env, status); | 194 return ConvertUTF8ToJavaString(env, status); |
| 190 } | 195 } |
| 191 | 196 |
| 192 jboolean ProfileSyncServiceAndroid::SetSyncSessionsId( | 197 jboolean ProfileSyncServiceAndroid::SetSyncSessionsId( |
| 193 JNIEnv* env, jobject obj, jstring tag) { | 198 JNIEnv* env, jobject obj, jstring tag) { |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 ProfileSyncServiceAndroid* profile_sync_service_android = | 543 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 539 new ProfileSyncServiceAndroid(env, obj); | 544 new ProfileSyncServiceAndroid(env, obj); |
| 540 profile_sync_service_android->Init(); | 545 profile_sync_service_android->Init(); |
| 541 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 546 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
| 542 } | 547 } |
| 543 | 548 |
| 544 // static | 549 // static |
| 545 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 550 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
| 546 return RegisterNativesImpl(env); | 551 return RegisterNativesImpl(env); |
| 547 } | 552 } |
| OLD | NEW |