diff options
Diffstat (limited to 'chrome/browser/sync/protocol')
-rw-r--r-- | chrome/browser/sync/protocol/app_specifics.proto | 15 | ||||
-rw-r--r-- | chrome/browser/sync/protocol/proto_value_conversions.cc | 9 | ||||
-rw-r--r-- | chrome/browser/sync/protocol/proto_value_conversions.h | 5 |
3 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/sync/protocol/app_specifics.proto b/chrome/browser/sync/protocol/app_specifics.proto index 4bfc225..e7eb7fb 100644 --- a/chrome/browser/sync/protocol/app_specifics.proto +++ b/chrome/browser/sync/protocol/app_specifics.proto @@ -17,6 +17,18 @@ package sync_pb; import "sync.proto"; import "extension_specifics.proto"; +// Settings related to push notifications for apps. +message AppNotificationSettings { + // Whether or not the user has setup notifications at least once. + // The value for this field will start out false and will be set + // to true when the user accepts receiving notifications for the + // first time and then it will always remain true. + optional bool initial_setup_done = 1; + + // Whether or not the user has disabled notifications. + optional bool disabled = 2; +} + // Properties of app sync objects. // // For now, an app is just an extension. We keep the two data types @@ -24,6 +36,9 @@ import "extension_specifics.proto"; message AppSpecifics { // Extension data. optional ExtensionSpecifics extension = 1; + + // Notification settings. + optional AppNotificationSettings notification_settings = 2; } extend EntitySpecifics { diff --git a/chrome/browser/sync/protocol/proto_value_conversions.cc b/chrome/browser/sync/protocol/proto_value_conversions.cc index 056e6df..82e7364 100644 --- a/chrome/browser/sync/protocol/proto_value_conversions.cc +++ b/chrome/browser/sync/protocol/proto_value_conversions.cc @@ -102,6 +102,14 @@ DictionaryValue* EncryptedDataToValue(const sync_pb::EncryptedData& proto) { return value; } +DictionaryValue* AppSettingsToValue( + const sync_pb::AppNotificationSettings& proto) { + DictionaryValue* value = new DictionaryValue(); + SET_BOOL(initial_setup_done); + SET_BOOL(disabled); + return value; +} + DictionaryValue* SessionHeaderToValue( const sync_pb::SessionHeader& proto) { DictionaryValue* value = new DictionaryValue(); @@ -182,6 +190,7 @@ DictionaryValue* AppSpecificsToValue( const sync_pb::AppSpecifics& proto) { DictionaryValue* value = new DictionaryValue(); SET(extension, ExtensionSpecificsToValue); + SET(notification_settings, AppSettingsToValue); return value; } diff --git a/chrome/browser/sync/protocol/proto_value_conversions.h b/chrome/browser/sync/protocol/proto_value_conversions.h index bb69a2e..82b636f 100644 --- a/chrome/browser/sync/protocol/proto_value_conversions.h +++ b/chrome/browser/sync/protocol/proto_value_conversions.h @@ -13,6 +13,7 @@ class DictionaryValue; } namespace sync_pb { +class AppNotificationSettings; class AppNotificationSpecifics; class AppSpecifics; class AutofillProfileSpecifics; @@ -54,6 +55,10 @@ namespace browser_sync { base::DictionaryValue* EncryptedDataToValue( const sync_pb::EncryptedData& encrypted_data); +// Sub-protocol of AppSpecifics. +base::DictionaryValue* AppSettingsToValue( + const sync_pb::AppNotificationSettings& app_notification_settings); + // Sub-protocols of SessionSpecifics. base::DictionaryValue* SessionHeaderToValue( |