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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) { | 135 void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) { |
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
137 DCHECK(profile_); | 137 DCHECK(profile_); |
138 sync_service_->DisableForUser(); | 138 sync_service_->DisableForUser(); |
139 | 139 |
140 // Need to clear suppress start flag manually | 140 // Need to clear suppress start flag manually |
141 sync_prefs_->SetStartSuppressed(false); | 141 sync_prefs_->SetStartSuppressed(false); |
142 } | 142 } |
143 | 143 |
| 144 void ProfileSyncServiceAndroid::FlushDirectory(JNIEnv* env, jobject) { |
| 145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 146 sync_service_->FlushDirectory(); |
| 147 } |
| 148 |
144 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary( | 149 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary( |
145 JNIEnv* env, jobject) { | 150 JNIEnv* env, jobject) { |
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
147 DCHECK(profile_); | 152 DCHECK(profile_); |
148 std::string status(sync_service_->QuerySyncStatusSummaryString()); | 153 std::string status(sync_service_->QuerySyncStatusSummaryString()); |
149 return ConvertUTF8ToJavaString(env, status); | 154 return ConvertUTF8ToJavaString(env, status); |
150 } | 155 } |
151 | 156 |
152 jboolean ProfileSyncServiceAndroid::SetSyncSessionsId( | 157 jboolean ProfileSyncServiceAndroid::SetSyncSessionsId( |
153 JNIEnv* env, jobject obj, jstring tag) { | 158 JNIEnv* env, jobject obj, jstring tag) { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 ProfileSyncServiceAndroid* profile_sync_service_android = | 481 ProfileSyncServiceAndroid* profile_sync_service_android = |
477 new ProfileSyncServiceAndroid(env, obj); | 482 new ProfileSyncServiceAndroid(env, obj); |
478 profile_sync_service_android->Init(); | 483 profile_sync_service_android->Init(); |
479 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 484 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
480 } | 485 } |
481 | 486 |
482 // static | 487 // static |
483 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 488 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
484 return RegisterNativesImpl(env); | 489 return RegisterNativesImpl(env); |
485 } | 490 } |
OLD | NEW |