Index: sync/syncable/model_type.cc |
diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc |
index 546ac0c876b207f42d6fb861166099c6bf314cd7..9693de6b600afadf9a474ed1ec0ce9c87f252fdc 100644 |
--- a/sync/syncable/model_type.cc |
+++ b/sync/syncable/model_type.cc |
@@ -76,6 +76,9 @@ void AddDefaultFieldValue(ModelType datatype, |
case HISTORY_DELETE_DIRECTIVES: |
specifics->mutable_history_delete_directive(); |
break; |
+ case SYNCED_NOTIFICATIONS: |
+ specifics->synced_notifications(); |
+ break; |
case DEVICE_INFO: |
specifics->mutable_device_info(); |
break; |
@@ -146,6 +149,8 @@ int GetSpecificsFieldNumberFromModelType(ModelType model_type) { |
break; |
case HISTORY_DELETE_DIRECTIVES: |
return sync_pb::EntitySpecifics::kHistoryDeleteDirectiveFieldNumber; |
+ case SYNCED_NOTIFICATIONS: |
+ return sync_pb::EntitySpecifics::kSyncedNotificationsFieldNumber; |
case DEVICE_INFO: |
return sync_pb::EntitySpecifics::kDeviceInfoFieldNumber; |
break; |
@@ -247,6 +252,9 @@ ModelType GetModelTypeFromSpecifics(const sync_pb::EntitySpecifics& specifics) { |
if (specifics.has_history_delete_directive()) |
return HISTORY_DELETE_DIRECTIVES; |
+ if (specifics.has_synced_notifications()) |
+ return SYNCED_NOTIFICATIONS; |
+ |
if (specifics.has_device_info()) |
return DEVICE_INFO; |
@@ -272,6 +280,8 @@ ModelTypeSet EncryptableUserTypes() { |
ModelTypeSet encryptable_user_types = UserTypes(); |
// We never encrypt history delete directives. |
encryptable_user_types.Remove(HISTORY_DELETE_DIRECTIVES); |
+ // Synced notifications are not encrypted since the server must see changes. |
+ encryptable_user_types.Remove(SYNCED_NOTIFICATIONS); |
return encryptable_user_types; |
} |
@@ -329,6 +339,8 @@ const char* ModelTypeToString(ModelType model_type) { |
return "App Notifications"; |
case HISTORY_DELETE_DIRECTIVES: |
return "History Delete Directives"; |
+ case SYNCED_NOTIFICATIONS: |
+ return "Synced Notifications"; |
case DEVICE_INFO: |
return "Device Info"; |
case EXPERIMENTS: |
@@ -400,6 +412,8 @@ ModelType ModelTypeFromString(const std::string& model_type_string) { |
return APP_NOTIFICATIONS; |
else if (model_type_string == "History Delete Directives") |
return HISTORY_DELETE_DIRECTIVES; |
+ else if (model_type_string == "Synced Notifications") |
+ return SYNCED_NOTIFICATIONS; |
else if (model_type_string == "Device Info") |
return DEVICE_INFO; |
else if (model_type_string == "Experiments") |
@@ -474,6 +488,8 @@ std::string ModelTypeToRootTag(ModelType type) { |
return "google_chrome_app_notifications"; |
case HISTORY_DELETE_DIRECTIVES: |
return "google_chrome_history_delete_directives"; |
+ case SYNCED_NOTIFICATIONS: |
+ return "synced_notifications_settings"; |
case DEVICE_INFO: |
return "google_chrome_device_info"; |
case EXPERIMENTS: |
@@ -505,6 +521,7 @@ const char kAutofillProfileNotificationType[] = "AUTOFILL_PROFILE"; |
const char kAppNotificationNotificationType[] = "APP_NOTIFICATION"; |
const char kHistoryDeleteDirectiveNotificationType[] = |
"HISTORY_DELETE_DIRECTIVE"; |
+const char kSyncedNotificationsType[] = "SYNCED_NOTIFICATIONS"; |
const char kDeviceInfoNotificationType[] = "DEVICE_INFO"; |
const char kExperimentsNotificationType[] = "EXPERIMENTS"; |
} // namespace |
@@ -559,6 +576,8 @@ bool RealModelTypeToNotificationType(ModelType model_type, |
return true; |
case HISTORY_DELETE_DIRECTIVES: |
*notification_type = kHistoryDeleteDirectiveNotificationType; |
+ case SYNCED_NOTIFICATIONS: |
+ *notification_type = kSyncedNotificationsType; |
case DEVICE_INFO: |
*notification_type = kDeviceInfoNotificationType; |
return true; |
@@ -621,6 +640,8 @@ bool NotificationTypeToRealModelType(const std::string& notification_type, |
return true; |
} else if (notification_type == kHistoryDeleteDirectiveNotificationType) { |
*model_type = HISTORY_DELETE_DIRECTIVES; |
+ } else if (notification_type == kSyncedNotificationsType) { |
+ *model_type = SYNCED_NOTIFICATIONS; |
} else if (notification_type == kDeviceInfoNotificationType) { |
*model_type = DEVICE_INFO;; |
return true; |