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

Unified Diff: sync/syncable/model_type.cc

Issue 19227004: [Sync] Add CoreTypes support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address final comments Created 7 years, 5 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
« no previous file with comments | « sync/internal_api/public/base/model_type.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/model_type.cc
diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc
index 5e227948b71d9a6b3566b3085ea147a7554f6a54..b9dacbecf155d6009130b90c8805ae51ebd1e48e 100644
--- a/sync/syncable/model_type.cc
+++ b/sync/syncable/model_type.cc
@@ -367,7 +367,7 @@ ModelTypeSet EncryptableUserTypes() {
encryptable_user_types.Remove(SYNCED_NOTIFICATIONS);
// Priority preferences are not encrypted because they might be synced before
// encryption is ready.
- encryptable_user_types.RemoveAll(PriorityUserTypes());
+ encryptable_user_types.Remove(PRIORITY_PREFERENCES);
// Managed user settings are not encrypted since they are set server-side.
encryptable_user_types.Remove(MANAGED_USER_SETTINGS);
// Managed users are not encrypted since they are managed server-side.
@@ -380,7 +380,7 @@ ModelTypeSet EncryptableUserTypes() {
}
ModelTypeSet PriorityUserTypes() {
- return ModelTypeSet(PRIORITY_PREFERENCES, MANAGED_USERS);
+ return ModelTypeSet(PRIORITY_PREFERENCES);
}
ModelTypeSet ControlTypes() {
@@ -405,6 +405,26 @@ bool IsControlType(ModelType model_type) {
return ControlTypes().Has(model_type);
}
+ModelTypeSet CoreTypes() {
+ syncer::ModelTypeSet result;
+ result.PutAll(PriorityCoreTypes());
+
+ // The following are low priority core types.
+ result.Put(SYNCED_NOTIFICATIONS);
+
+ return result;
+}
+
+ModelTypeSet PriorityCoreTypes() {
+ syncer::ModelTypeSet result;
+ result.PutAll(ControlTypes());
+
+ // The following are non-control core types.
+ result.Put(MANAGED_USERS);
+
+ return result;
+}
+
const char* ModelTypeToString(ModelType model_type) {
// This is used in serialization routines as well as for displaying debug
// information. Do not attempt to change these string values unless you know
« no previous file with comments | « sync/internal_api/public/base/model_type.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698