| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 HISTORY_DELETE_DIRECTIVE = 1 << 6, | 59 HISTORY_DELETE_DIRECTIVE = 1 << 6, |
| 60 PROXY_TABS = 1 << 7, | 60 PROXY_TABS = 1 << 7, |
| 61 FAVICON_IMAGE = 1 << 8, | 61 FAVICON_IMAGE = 1 << 8, |
| 62 FAVICON_TRACKING = 1 << 9, | 62 FAVICON_TRACKING = 1 << 9, |
| 63 NIGORI = 1 << 10, | 63 NIGORI = 1 << 10, |
| 64 DEVICE_INFO = 1 << 11, | 64 DEVICE_INFO = 1 << 11, |
| 65 EXPERIMENTS = 1 << 12, | 65 EXPERIMENTS = 1 << 12, |
| 66 SUPERVISED_USER_SETTING = 1 << 13, | 66 SUPERVISED_USER_SETTING = 1 << 13, |
| 67 SUPERVISED_USER_WHITELIST = 1 << 14, | 67 SUPERVISED_USER_WHITELIST = 1 << 14, |
| 68 AUTOFILL_WALLET = 1 << 15, | 68 AUTOFILL_WALLET = 1 << 15, |
| 69 AUTOFILL_WALLET_METADATA = 1 << 16, |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 } // namespace | 72 } // namespace |
| 72 | 73 |
| 73 ProfileSyncServiceAndroid::ProfileSyncServiceAndroid(JNIEnv* env, jobject obj) | 74 ProfileSyncServiceAndroid::ProfileSyncServiceAndroid(JNIEnv* env, jobject obj) |
| 74 : profile_(NULL), | 75 : profile_(NULL), |
| 75 sync_service_(NULL), | 76 sync_service_(NULL), |
| 76 weak_java_profile_sync_service_(env, obj) { | 77 weak_java_profile_sync_service_(env, obj) { |
| 77 if (g_browser_process == NULL || | 78 if (g_browser_process == NULL || |
| 78 g_browser_process->profile_manager() == NULL) { | 79 g_browser_process->profile_manager() == NULL) { |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } | 475 } |
| 475 if (types.Has(syncer::AUTOFILL)) { | 476 if (types.Has(syncer::AUTOFILL)) { |
| 476 model_type_selection |= AUTOFILL; | 477 model_type_selection |= AUTOFILL; |
| 477 } | 478 } |
| 478 if (types.Has(syncer::AUTOFILL_PROFILE)) { | 479 if (types.Has(syncer::AUTOFILL_PROFILE)) { |
| 479 model_type_selection |= AUTOFILL_PROFILE; | 480 model_type_selection |= AUTOFILL_PROFILE; |
| 480 } | 481 } |
| 481 if (types.Has(syncer::AUTOFILL_WALLET_DATA)) { | 482 if (types.Has(syncer::AUTOFILL_WALLET_DATA)) { |
| 482 model_type_selection |= AUTOFILL_WALLET; | 483 model_type_selection |= AUTOFILL_WALLET; |
| 483 } | 484 } |
| 485 if (types.Has(syncer::AUTOFILL_WALLET_METADATA)) { |
| 486 model_type_selection |= AUTOFILL_WALLET_METADATA; |
| 487 } |
| 484 if (types.Has(syncer::PASSWORDS)) { | 488 if (types.Has(syncer::PASSWORDS)) { |
| 485 model_type_selection |= PASSWORD; | 489 model_type_selection |= PASSWORD; |
| 486 } | 490 } |
| 487 if (types.Has(syncer::TYPED_URLS)) { | 491 if (types.Has(syncer::TYPED_URLS)) { |
| 488 model_type_selection |= TYPED_URL; | 492 model_type_selection |= TYPED_URL; |
| 489 } | 493 } |
| 490 if (types.Has(syncer::SESSIONS)) { | 494 if (types.Has(syncer::SESSIONS)) { |
| 491 model_type_selection |= SESSION; | 495 model_type_selection |= SESSION; |
| 492 } | 496 } |
| 493 if (types.Has(syncer::HISTORY_DELETE_DIRECTIVES)) { | 497 if (types.Has(syncer::HISTORY_DELETE_DIRECTIVES)) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 ProfileSyncServiceAndroid* profile_sync_service_android = | 545 ProfileSyncServiceAndroid* profile_sync_service_android = |
| 542 new ProfileSyncServiceAndroid(env, obj); | 546 new ProfileSyncServiceAndroid(env, obj); |
| 543 profile_sync_service_android->Init(); | 547 profile_sync_service_android->Init(); |
| 544 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 548 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
| 545 } | 549 } |
| 546 | 550 |
| 547 // static | 551 // static |
| 548 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 552 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
| 549 return RegisterNativesImpl(env); | 553 return RegisterNativesImpl(env); |
| 550 } | 554 } |
| OLD | NEW |