| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #define DEFINE_MODEL_TYPE_SELECTION(name,value) name = value, | 53 #define DEFINE_MODEL_TYPE_SELECTION(name,value) name = value, |
| 54 #include "chrome/browser/sync/profile_sync_service_model_type_selection_android.
h" | 54 #include "chrome/browser/sync/profile_sync_service_model_type_selection_android.
h" |
| 55 #undef DEFINE_MODEL_TYPE_SELECTION | 55 #undef DEFINE_MODEL_TYPE_SELECTION |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 ProfileSyncServiceAndroid::ProfileSyncServiceAndroid(JNIEnv* env, jobject obj) | 60 ProfileSyncServiceAndroid::ProfileSyncServiceAndroid(JNIEnv* env, jobject obj) |
| 61 : profile_(NULL), | 61 : profile_(NULL), |
| 62 sync_service_(NULL), | 62 sync_service_(NULL), |
| 63 sync_prefs_(NULL), | |
| 64 weak_java_profile_sync_service_(env, obj) { | 63 weak_java_profile_sync_service_(env, obj) { |
| 65 if (g_browser_process == NULL || | 64 if (g_browser_process == NULL || |
| 66 g_browser_process->profile_manager() == NULL) { | 65 g_browser_process->profile_manager() == NULL) { |
| 67 NOTREACHED() << "Browser process or profile manager not initialized"; | 66 NOTREACHED() << "Browser process or profile manager not initialized"; |
| 68 return; | 67 return; |
| 69 } | 68 } |
| 70 | 69 |
| 71 profile_ = g_browser_process->profile_manager()->GetDefaultProfile(); | 70 profile_ = g_browser_process->profile_manager()->GetDefaultProfile(); |
| 72 if (profile_ == NULL) { | 71 if (profile_ == NULL) { |
| 73 NOTREACHED() << "Sync Init: Profile not found."; | 72 NOTREACHED() << "Sync Init: Profile not found."; |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 ProfileSyncServiceAndroid* profile_sync_service_android = | 637 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 639 new ProfileSyncServiceAndroid(env, obj); | 638 new ProfileSyncServiceAndroid(env, obj); |
| 640 profile_sync_service_android->Init(); | 639 profile_sync_service_android->Init(); |
| 641 return reinterpret_cast<jint>(profile_sync_service_android); | 640 return reinterpret_cast<jint>(profile_sync_service_android); |
| 642 } | 641 } |
| 643 | 642 |
| 644 // static | 643 // static |
| 645 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 644 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
| 646 return RegisterNativesImpl(env); | 645 return RegisterNativesImpl(env); |
| 647 } | 646 } |
| OLD | NEW |