| 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" |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
| 19 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
| 20 #include "chrome/browser/signin/signin_manager_factory.h" | 20 #include "chrome/browser/signin/signin_manager_factory.h" |
| 21 #include "chrome/browser/sync/about_sync_util.h" | 21 #include "chrome/browser/sync/about_sync_util.h" |
| 22 #include "chrome/browser/sync/profile_sync_service.h" | 22 #include "chrome/browser/sync/profile_sync_service.h" |
| 23 #include "chrome/browser/sync/profile_sync_service_factory.h" | 23 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 24 #include "chrome/browser/sync/sync_ui_util.h" | 24 #include "chrome/browser/sync/sync_ui_util.h" |
| 25 #include "chrome/grit/generated_resources.h" |
| 25 #include "components/invalidation/object_id_invalidation_map.h" | 26 #include "components/invalidation/object_id_invalidation_map.h" |
| 26 #include "components/signin/core/browser/signin_manager.h" | 27 #include "components/signin/core/browser/signin_manager.h" |
| 27 #include "components/sync_driver/pref_names.h" | 28 #include "components/sync_driver/pref_names.h" |
| 28 #include "components/sync_driver/sync_prefs.h" | 29 #include "components/sync_driver/sync_prefs.h" |
| 29 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
| 30 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 31 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
| 32 #include "google/cacheinvalidation/types.pb.h" | 33 #include "google/cacheinvalidation/types.pb.h" |
| 33 #include "google_apis/gaia/gaia_constants.h" | 34 #include "google_apis/gaia/gaia_constants.h" |
| 34 #include "google_apis/gaia/google_service_auth_error.h" | 35 #include "google_apis/gaia/google_service_auth_error.h" |
| 35 #include "grit/generated_resources.h" | |
| 36 #include "jni/ProfileSyncService_jni.h" | 36 #include "jni/ProfileSyncService_jni.h" |
| 37 #include "sync/internal_api/public/read_transaction.h" | 37 #include "sync/internal_api/public/read_transaction.h" |
| 38 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
| 39 | 39 |
| 40 using base::android::AttachCurrentThread; | 40 using base::android::AttachCurrentThread; |
| 41 using base::android::CheckException; | 41 using base::android::CheckException; |
| 42 using base::android::ConvertJavaStringToUTF8; | 42 using base::android::ConvertJavaStringToUTF8; |
| 43 using base::android::ConvertUTF8ToJavaString; | 43 using base::android::ConvertUTF8ToJavaString; |
| 44 using base::android::ScopedJavaLocalRef; | 44 using base::android::ScopedJavaLocalRef; |
| 45 using content::BrowserThread; | 45 using content::BrowserThread; |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 ProfileSyncServiceAndroid* profile_sync_service_android = | 509 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 510 new ProfileSyncServiceAndroid(env, obj); | 510 new ProfileSyncServiceAndroid(env, obj); |
| 511 profile_sync_service_android->Init(); | 511 profile_sync_service_android->Init(); |
| 512 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 512 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
| 513 } | 513 } |
| 514 | 514 |
| 515 // static | 515 // static |
| 516 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 516 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
| 517 return RegisterNativesImpl(env); | 517 return RegisterNativesImpl(env); |
| 518 } | 518 } |
| OLD | NEW |