| Index: sync/syncable/model_type.cc
|
| diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc
|
| index 546ac0c876b207f42d6fb861166099c6bf314cd7..c9a7ebfb5cf3732ee953e932b51946a086e2482c 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 PUSH_NOTIFICATIONS:
|
| + specifics->push_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 PUSH_NOTIFICATIONS:
|
| + return sync_pb::EntitySpecifics::kPushNotificationsFieldNumber;
|
| 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_push_notifications())
|
| + return PUSH_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);
|
| + // Push notifications are not encrypted since the server must see changes.
|
| + encryptable_user_types.Remove(PUSH_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 PUSH_NOTIFICATIONS:
|
| + return "Push 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 == "Push Notifications")
|
| + return PUSH_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 PUSH_NOTIFICATIONS:
|
| + return "push_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 kPushNotificationsType[] = "PUSH_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 PUSH_NOTIFICATIONS:
|
| + *notification_type = kPushNotificationsType;
|
| 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 == kPushNotificationsType) {
|
| + *model_type = PUSH_NOTIFICATIONS;
|
| } else if (notification_type == kDeviceInfoNotificationType) {
|
| *model_type = DEVICE_INFO;;
|
| return true;
|
|
|