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