diff options
author | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 07:24:32 +0000 |
---|---|---|
committer | munjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-28 07:24:32 +0000 |
commit | aa7599d594fa6e389038823833ae631019356bfc (patch) | |
tree | 8be8c52f1ad9be848f5ae4109ec64f68b396d1e4 /chrome/browser/sync/protocol | |
parent | b9ca82db290140465e02afb9160c117e50494dd6 (diff) | |
download | chromium_src-aa7599d594fa6e389038823833ae631019356bfc.zip chromium_src-aa7599d594fa6e389038823833ae631019356bfc.tar.gz chromium_src-aa7599d594fa6e389038823833ae631019356bfc.tar.bz2 |
Add a couple of notifications related settings to app/extensions sync:
- Whether notifications setup is done once already.
- Whether the user has disabled notifications.
Review URL: http://codereview.chromium.org/8399022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107692 0039d316-1c4b-4281-b951-d872f2087c98
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( |