Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: chrome/browser/sync/profile_sync_service_android.cc

Issue 493293002: Enable invalidations for supervised user settings on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 'nother compile fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service_android.cc
diff --git a/chrome/browser/sync/profile_sync_service_android.cc b/chrome/browser/sync/profile_sync_service_android.cc
index 2432f5471b286044b759c296237b244d1ce70174..567297cc9c73ec7f3cee65a6117d4c43ed2b2733 100644
--- a/chrome/browser/sync/profile_sync_service_android.cc
+++ b/chrome/browser/sync/profile_sync_service_android.cc
@@ -347,49 +347,9 @@ jboolean ProfileSyncServiceAndroid::IsSyncKeystoreMigrationDone(
jlong ProfileSyncServiceAndroid::GetEnabledDataTypes(JNIEnv* env,
jobject obj) {
- jlong model_type_selection = 0;
syncer::ModelTypeSet types = sync_service_->GetActiveDataTypes();
types.PutAll(syncer::ControlTypes());
- if (types.Has(syncer::BOOKMARKS)) {
- model_type_selection |= BOOKMARK;
- }
- if (types.Has(syncer::AUTOFILL)) {
- model_type_selection |= AUTOFILL;
- }
- if (types.Has(syncer::AUTOFILL_PROFILE)) {
- model_type_selection |= AUTOFILL_PROFILE;
- }
- if (types.Has(syncer::PASSWORDS)) {
- model_type_selection |= PASSWORD;
- }
- if (types.Has(syncer::TYPED_URLS)) {
- model_type_selection |= TYPED_URL;
- }
- if (types.Has(syncer::SESSIONS)) {
- model_type_selection |= SESSION;
- }
- if (types.Has(syncer::HISTORY_DELETE_DIRECTIVES)) {
- model_type_selection |= HISTORY_DELETE_DIRECTIVE;
- }
- if (types.Has(syncer::PROXY_TABS)) {
- model_type_selection |= PROXY_TABS;
- }
- if (types.Has(syncer::FAVICON_IMAGES)) {
- model_type_selection |= FAVICON_IMAGE;
- }
- if (types.Has(syncer::FAVICON_TRACKING)) {
- model_type_selection |= FAVICON_TRACKING;
- }
- if (types.Has(syncer::DEVICE_INFO)) {
- model_type_selection |= DEVICE_INFO;
- }
- if (types.Has(syncer::NIGORI)) {
- model_type_selection |= NIGORI;
- }
- if (types.Has(syncer::EXPERIMENTS)) {
- model_type_selection |= EXPERIMENTS;
- }
- return model_type_selection;
+ return ModelTypeSetToSelection(types);
}
void ProfileSyncServiceAndroid::SetPreferredDataTypes(
@@ -486,6 +446,64 @@ void ProfileSyncServiceAndroid::OverrideNetworkResourcesForTest(
make_scoped_ptr<syncer::NetworkResources>(resources));
}
+// static
+jlong ProfileSyncServiceAndroid::ModelTypeSetToSelection(
+ syncer::ModelTypeSet types) {
+ jlong model_type_selection = 0;
+ if (types.Has(syncer::BOOKMARKS)) {
+ model_type_selection |= BOOKMARK;
+ }
+ if (types.Has(syncer::AUTOFILL)) {
+ model_type_selection |= AUTOFILL;
+ }
+ if (types.Has(syncer::AUTOFILL_PROFILE)) {
+ model_type_selection |= AUTOFILL_PROFILE;
+ }
+ if (types.Has(syncer::PASSWORDS)) {
+ model_type_selection |= PASSWORD;
+ }
+ if (types.Has(syncer::TYPED_URLS)) {
+ model_type_selection |= TYPED_URL;
+ }
+ if (types.Has(syncer::SESSIONS)) {
+ model_type_selection |= SESSION;
+ }
+ if (types.Has(syncer::HISTORY_DELETE_DIRECTIVES)) {
+ model_type_selection |= HISTORY_DELETE_DIRECTIVE;
+ }
+ if (types.Has(syncer::PROXY_TABS)) {
+ model_type_selection |= PROXY_TABS;
+ }
+ if (types.Has(syncer::FAVICON_IMAGES)) {
+ model_type_selection |= FAVICON_IMAGE;
+ }
+ if (types.Has(syncer::FAVICON_TRACKING)) {
+ model_type_selection |= FAVICON_TRACKING;
+ }
+ if (types.Has(syncer::DEVICE_INFO)) {
+ model_type_selection |= DEVICE_INFO;
+ }
+ if (types.Has(syncer::NIGORI)) {
+ model_type_selection |= NIGORI;
+ }
+ if (types.Has(syncer::EXPERIMENTS)) {
+ model_type_selection |= EXPERIMENTS;
+ }
+ if (types.Has(syncer::SUPERVISED_USER_SETTINGS)) {
+ model_type_selection |= SUPERVISED_USER_SETTING;
+ }
+ return model_type_selection;
+}
+
+// static
+std::string ProfileSyncServiceAndroid::ModelTypeSelectionToStringForTest(
+ jlong model_type_selection) {
+ ScopedJavaLocalRef<jstring> string =
+ Java_ProfileSyncService_modelTypeSelectionToStringForTest(
+ AttachCurrentThread(), model_type_selection);
+ return ConvertJavaStringToUTF8(string);
+}
+
void ProfileSyncServiceAndroid::NudgeSyncer(JNIEnv* env,
jobject obj,
jint objectSource,

Powered by Google App Engine
This is Rietveld 408576698