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 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 using base::android::AttachCurrentThread; | 37 using base::android::AttachCurrentThread; |
38 using base::android::CheckException; | 38 using base::android::CheckException; |
39 using base::android::ConvertJavaStringToUTF8; | 39 using base::android::ConvertJavaStringToUTF8; |
40 using base::android::ConvertUTF8ToJavaString; | 40 using base::android::ConvertUTF8ToJavaString; |
41 using base::android::ScopedJavaLocalRef; | 41 using base::android::ScopedJavaLocalRef; |
42 using content::BrowserThread; | 42 using content::BrowserThread; |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 enum { | 46 // This enum contains the list of sync ModelTypes that Android can register for |
47 #define DEFINE_MODEL_TYPE_SELECTION(name,value) name = value, | 47 // invalidations for. |
48 #include "chrome/browser/sync/profile_sync_service_model_type_selection_android. h" | 48 // |
49 #undef DEFINE_MODEL_TYPE_SELECTION | 49 // A Java counterpart will be generated for this enum. |
50 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.sync | |
51 enum ModelTypeSelection { | |
52 AUTOFILL = 1 << 0, | |
Yaron
2014/10/15 02:36:49
Did you check that this actually worked? Can you a
mkosiba (inactive)
2014/10/16 12:45:07
The generated files don't differ (the template mec
| |
53 BOOKMARK = 1 << 1, | |
54 PASSWORD = 1 << 2, | |
55 SESSION = 1 << 3, | |
56 TYPED_URL = 1 << 4, | |
57 AUTOFILL_PROFILE = 1 << 5, | |
58 HISTORY_DELETE_DIRECTIVE = 1 << 6, | |
59 PROXY_TABS = 1 << 7, | |
60 FAVICON_IMAGE = 1 << 8, | |
61 FAVICON_TRACKING = 1 << 9, | |
62 NIGORI = 1 << 10, | |
63 DEVICE_INFO = 1 << 11, | |
64 EXPERIMENTS = 1 << 12, | |
65 SUPERVISED_USER_SETTING = 1 << 13, | |
50 }; | 66 }; |
51 | 67 |
52 } // namespace | 68 } // namespace |
53 | 69 |
54 ProfileSyncServiceAndroid::ProfileSyncServiceAndroid(JNIEnv* env, jobject obj) | 70 ProfileSyncServiceAndroid::ProfileSyncServiceAndroid(JNIEnv* env, jobject obj) |
55 : profile_(NULL), | 71 : profile_(NULL), |
56 sync_service_(NULL), | 72 sync_service_(NULL), |
57 weak_java_profile_sync_service_(env, obj) { | 73 weak_java_profile_sync_service_(env, obj) { |
58 if (g_browser_process == NULL || | 74 if (g_browser_process == NULL || |
59 g_browser_process->profile_manager() == NULL) { | 75 g_browser_process->profile_manager() == NULL) { |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
488 ProfileSyncServiceAndroid* profile_sync_service_android = | 504 ProfileSyncServiceAndroid* profile_sync_service_android = |
489 new ProfileSyncServiceAndroid(env, obj); | 505 new ProfileSyncServiceAndroid(env, obj); |
490 profile_sync_service_android->Init(); | 506 profile_sync_service_android->Init(); |
491 return reinterpret_cast<intptr_t>(profile_sync_service_android); | 507 return reinterpret_cast<intptr_t>(profile_sync_service_android); |
492 } | 508 } |
493 | 509 |
494 // static | 510 // static |
495 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { | 511 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { |
496 return RegisterNativesImpl(env); | 512 return RegisterNativesImpl(env); |
497 } | 513 } |
OLD | NEW |