| 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 <memory> | 10 #include <memory> |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 const JavaParamRef<jobject>&) { | 179 const JavaParamRef<jobject>&) { |
| 180 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 180 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 181 return sync_service_->IsBackendInitialized(); | 181 return sync_service_->IsBackendInitialized(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void ProfileSyncServiceAndroid::SetSetupInProgress( | 184 void ProfileSyncServiceAndroid::SetSetupInProgress( |
| 185 JNIEnv* env, | 185 JNIEnv* env, |
| 186 const JavaParamRef<jobject>& obj, | 186 const JavaParamRef<jobject>& obj, |
| 187 jboolean in_progress) { | 187 jboolean in_progress) { |
| 188 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 188 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 189 sync_service_->SetSetupInProgress(in_progress); | 189 if (in_progress) { |
| 190 setup_handle_ = sync_service_->GetSetupInProgressHandle(); |
| 191 } else { |
| 192 setup_handle_.reset(); |
| 193 } |
| 190 } | 194 } |
| 191 | 195 |
| 192 jboolean ProfileSyncServiceAndroid::IsFirstSetupComplete( | 196 jboolean ProfileSyncServiceAndroid::IsFirstSetupComplete( |
| 193 JNIEnv* env, | 197 JNIEnv* env, |
| 194 const JavaParamRef<jobject>& obj) { | 198 const JavaParamRef<jobject>& obj) { |
| 195 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 199 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 196 return sync_service_->IsFirstSetupComplete(); | 200 return sync_service_->IsFirstSetupComplete(); |
| 197 } | 201 } |
| 198 | 202 |
| 199 void ProfileSyncServiceAndroid::SetFirstSetupComplete( | 203 void ProfileSyncServiceAndroid::SetFirstSetupComplete( |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 505 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 502 ProfileSyncServiceAndroid* profile_sync_service_android = | 506 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 503 new ProfileSyncServiceAndroid(env, obj); | 507 new ProfileSyncServiceAndroid(env, obj); |
| 504 if (profile_sync_service_android->Init()) { | 508 if (profile_sync_service_android->Init()) { |
| 505 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 509 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
| 506 } else { | 510 } else { |
| 507 delete profile_sync_service_android; | 511 delete profile_sync_service_android; |
| 508 return 0; | 512 return 0; |
| 509 } | 513 } |
| 510 } | 514 } |
| OLD | NEW |