Index: chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
index 7874dff69f02e25f669be4151ab65869aa158510..df8aae83b654b736d42174a72815fff77f02e9e9 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
@@ -364,22 +364,47 @@ public class ProfileSyncService { |
* @return Set of enabled types. |
*/ |
public Set<ModelType> getPreferredDataTypes() { |
+ long modelTypeSelection = |
+ nativeGetEnabledDataTypes(mNativeProfileSyncServiceAndroid); |
Set<ModelType> syncTypes = new HashSet<ModelType>(); |
- |
- if (nativeIsAutofillSyncEnabled(mNativeProfileSyncServiceAndroid)) { |
- syncTypes.add(ModelType.AUTOFILL); |
+ if ((modelTypeSelection & ModelTypeSelection.AUTOFILL) != 0) { |
+ syncTypes.add(ModelType.AUTOFILL); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.AUTOFILL_PROFILE) != 0) { |
+ syncTypes.add(ModelType.AUTOFILL_PROFILE); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.BOOKMARK) != 0) { |
+ syncTypes.add(ModelType.BOOKMARK); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.EXPERIMENTS) != 0) { |
+ syncTypes.add(ModelType.EXPERIMENTS); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.NIGORI) != 0) { |
+ syncTypes.add(ModelType.NIGORI); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.PASSWORD) != 0) { |
+ syncTypes.add(ModelType.PASSWORD); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.SESSION) != 0) { |
+ syncTypes.add(ModelType.SESSION); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.TYPED_URL) != 0) { |
+ syncTypes.add(ModelType.TYPED_URL); |
+ } |
+ if ((modelTypeSelection & ModelTypeSelection.HISTORY_DELETE_DIRECTIVE) != 0) { |
+ syncTypes.add(ModelType.HISTORY_DELETE_DIRECTIVE); |
} |
- if (nativeIsBookmarkSyncEnabled(mNativeProfileSyncServiceAndroid)) { |
- syncTypes.add(ModelType.BOOKMARK); |
+ if ((modelTypeSelection & ModelTypeSelection.DEVICE_INFO) != 0) { |
+ syncTypes.add(ModelType.DEVICE_INFO); |
} |
- if (nativeIsPasswordSyncEnabled(mNativeProfileSyncServiceAndroid)) { |
- syncTypes.add(ModelType.PASSWORD); |
+ if ((modelTypeSelection & ModelTypeSelection.PROXY_TABS) != 0) { |
+ syncTypes.add(ModelType.PROXY_TABS); |
} |
- if (nativeIsTypedUrlSyncEnabled(mNativeProfileSyncServiceAndroid)) { |
- syncTypes.add(ModelType.TYPED_URL); |
+ if ((modelTypeSelection & ModelTypeSelection.FAVICON_IMAGE) != 0) { |
+ syncTypes.add(ModelType.FAVICON_IMAGE); |
} |
- if (nativeIsSessionSyncEnabled(mNativeProfileSyncServiceAndroid)) { |
- syncTypes.add(ModelType.SESSION); |
+ if ((modelTypeSelection & ModelTypeSelection.FAVICON_TRACKING) != 0) { |
+ syncTypes.add(ModelType.FAVICON_TRACKING); |
} |
return syncTypes; |
} |
@@ -520,6 +545,8 @@ public class ProfileSyncService { |
private native String nativeGetSyncEnterCustomPassphraseBodyText( |
int nativeProfileSyncServiceAndroid); |
private native boolean nativeIsSyncKeystoreMigrationDone(int nativeProfileSyncServiceAndroid); |
+ private native long nativeGetEnabledDataTypes( |
+ int nativeProfileSyncServiceAndroid); |
private native void nativeSetPreferredDataTypes( |
int nativeProfileSyncServiceAndroid, boolean syncEverything, long modelTypeSelection); |
private native void nativeSetSetupInProgress( |
@@ -527,11 +554,6 @@ public class ProfileSyncService { |
private native void nativeSetSyncSetupCompleted(int nativeProfileSyncServiceAndroid); |
private native boolean nativeHasSyncSetupCompleted(int nativeProfileSyncServiceAndroid); |
private native boolean nativeHasKeepEverythingSynced(int nativeProfileSyncServiceAndroid); |
- private native boolean nativeIsAutofillSyncEnabled(int nativeProfileSyncServiceAndroid); |
- private native boolean nativeIsBookmarkSyncEnabled(int nativeProfileSyncServiceAndroid); |
- private native boolean nativeIsPasswordSyncEnabled(int nativeProfileSyncServiceAndroid); |
- private native boolean nativeIsTypedUrlSyncEnabled(int nativeProfileSyncServiceAndroid); |
- private native boolean nativeIsSessionSyncEnabled(int nativeProfileSyncServiceAndroid); |
private native boolean nativeHasUnrecoverableError(int nativeProfileSyncServiceAndroid); |
private native String nativeGetAboutInfoForTest(int nativeProfileSyncServiceAndroid); |
} |