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> |
11 | 11 |
12 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
13 #include "base/android/jni_array.h" | 13 #include "base/android/jni_array.h" |
14 #include "base/android/jni_string.h" | 14 #include "base/android/jni_string.h" |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/i18n/time_formatting.h" | 16 #include "base/i18n/time_formatting.h" |
17 #include "base/json/json_writer.h" | 17 #include "base/json/json_writer.h" |
18 #include "base/logging.h" | 18 #include "base/logging.h" |
19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "base/time/time.h" | |
22 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/browser/signin/signin_manager_factory.h" | 23 #include "chrome/browser/signin/signin_manager_factory.h" |
25 #include "chrome/browser/sync/profile_sync_service_factory.h" | 24 #include "chrome/browser/sync/profile_sync_service_factory.h" |
26 #include "chrome/browser/sync/sync_ui_util.h" | 25 #include "chrome/browser/sync/sync_ui_util.h" |
27 #include "chrome/common/channel_info.h" | 26 #include "chrome/common/channel_info.h" |
28 #include "chrome/grit/generated_resources.h" | 27 #include "chrome/grit/generated_resources.h" |
29 #include "components/browser_sync/profile_sync_service.h" | 28 #include "components/browser_sync/profile_sync_service.h" |
30 #include "components/prefs/pref_service.h" | 29 #include "components/prefs/pref_service.h" |
31 #include "components/signin/core/browser/signin_manager.h" | 30 #include "components/signin/core/browser/signin_manager.h" |
32 #include "components/strings/grit/components_strings.h" | 31 #include "components/strings/grit/components_strings.h" |
33 #include "components/sync/core/network_resources.h" | 32 #include "components/sync/core/network_resources.h" |
34 #include "components/sync/core/read_transaction.h" | 33 #include "components/sync/core/read_transaction.h" |
35 #include "components/sync/driver/about_sync_util.h" | 34 #include "components/sync/driver/about_sync_util.h" |
36 #include "components/sync/driver/pref_names.h" | 35 #include "components/sync/driver/pref_names.h" |
37 #include "components/sync/driver/sync_prefs.h" | |
38 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
39 #include "google/cacheinvalidation/types.pb.h" | 37 #include "google/cacheinvalidation/types.pb.h" |
40 #include "google_apis/gaia/gaia_constants.h" | 38 #include "google_apis/gaia/gaia_constants.h" |
41 #include "google_apis/gaia/google_service_auth_error.h" | |
42 #include "jni/ProfileSyncService_jni.h" | 39 #include "jni/ProfileSyncService_jni.h" |
43 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
44 | 41 |
45 using base::android::AttachCurrentThread; | 42 using base::android::AttachCurrentThread; |
46 using base::android::CheckException; | 43 using base::android::CheckException; |
47 using base::android::ConvertJavaStringToUTF8; | 44 using base::android::ConvertJavaStringToUTF8; |
48 using base::android::ConvertUTF8ToJavaString; | 45 using base::android::ConvertUTF8ToJavaString; |
49 using base::android::JavaParamRef; | 46 using base::android::JavaParamRef; |
50 using base::android::ScopedJavaLocalRef; | 47 using base::android::ScopedJavaLocalRef; |
51 using browser_sync::ProfileSyncService; | 48 using browser_sync::ProfileSyncService; |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 511 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
515 ProfileSyncServiceAndroid* profile_sync_service_android = | 512 ProfileSyncServiceAndroid* profile_sync_service_android = |
516 new ProfileSyncServiceAndroid(env, obj); | 513 new ProfileSyncServiceAndroid(env, obj); |
517 if (profile_sync_service_android->Init()) { | 514 if (profile_sync_service_android->Init()) { |
518 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 515 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
519 } else { | 516 } else { |
520 delete profile_sync_service_android; | 517 delete profile_sync_service_android; |
521 return 0; | 518 return 0; |
522 } | 519 } |
523 } | 520 } |
OLD | NEW |