From 2bb710732f471f05c0ea249a52a566d36adff015 Mon Sep 17 00:00:00 2001 From: "petewil@chromium.org" Date: Thu, 3 Apr 2014 19:12:41 +0000 Subject: Update to latest protobufs to match the server side. To unlock features with seen/unseen state, hidpi screens, and locale awareness, update to the latest version of the protobuf used by the server side. BUG=305901 Review URL: https://codereview.chromium.org/217203003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261499 0039d316-1c4b-4281-b951-d872f2087c98 --- .../synced_notification_app_info_specifics.proto | 34 +++++++-- sync/protocol/synced_notification_data.proto | 81 +++++++++++++++++++++- 2 files changed, 107 insertions(+), 8 deletions(-) (limited to 'sync') diff --git a/sync/protocol/synced_notification_app_info_specifics.proto b/sync/protocol/synced_notification_app_info_specifics.proto index 22bb4d2..09726ff 100644 --- a/sync/protocol/synced_notification_app_info_specifics.proto +++ b/sync/protocol/synced_notification_app_info_specifics.proto @@ -21,14 +21,36 @@ message SyncedNotificationAppInfoSpecifics { } message SyncedNotificationAppInfo { - // The application ID of a subservice within the notification sending service. + // The application ID (the subservice within the sending service). repeated string app_id = 1; // The name to use in the settings screen for this app. - optional string settings_display_name = 2; + // Use app_name field instead. + optional string settings_display_name = 2 [deprecated = true]; - // The icon to use. The URL of the icon may point to a - // hi-res image, so clients should always size the image to the - // preferred width and height specified in the Image proto. - optional SyncedNotificationImage icon = 3; + // This field is deprecated. Use the app_icon field instead. + optional SyncedNotificationImage icon = 3 [deprecated = true]; + + optional string app_name = 4; + + optional string settings_url = 5; + + optional string info_url = 6; + + message Icon { + enum Type { + GRAYSCALE_FAVICON_1X = 1; // Grayscale 16x16 px icon. + GRAYSCALE_FAVICON_2X = 2; // Grayscale 32x32 px icon. + COLOR_FAVICON_1X = 3; // Color 16x16 px icon. + COLOR_FAVICON_2X = 4; // Color 32x32 px icon. + COLOR_APPICON_1X = 5; // Color 80x80 px icon. + COLOR_APPICON_2X = 6; // Color 160x160 px icon. + }; + optional Type type = 1; + + optional string url = 2; + }; + + // A repeated set of icons of different resolutions and types. + repeated Icon app_icon = 7; } \ No newline at end of file diff --git a/sync/protocol/synced_notification_data.proto b/sync/protocol/synced_notification_data.proto index 72c612d..abd52a8 100644 --- a/sync/protocol/synced_notification_data.proto +++ b/sync/protocol/synced_notification_data.proto @@ -85,20 +85,36 @@ message CoalescedSyncedNotification { UNREAD = 1; READ = 2; DISMISSED = 3; + SEEN = 4; } optional ReadState read_state = 5; // The time when the LATEST notification of the coalesced notification is // created (in milliseconds since the linux epoch). + // This is called updated_version in the server side protobuf. optional uint64 creation_time_msec = 6; enum Priority { - LOW = 1; - STANDARD = 2; + INVISIBLE = 1; + LOW = 2; HIGH = 3; // We will most likely add at least one more priority in the near future. }; optional Priority priority = 7; + + // Security token that is to be used when making a PerformUserAction request + // when any user action within this coalesced notification is triggered. + optional string user_action_token = 8; + + // This field corresponds to catchup_version in entity, which represents the + // version entity was last modified. Note that the + // Entity.last_modified_version will be actually the last creation version. + // See comments in updated_version. + optional uint64 last_modified_version = 9; + + // Clients should use this field to order the notifications. Currently this is + // calculated from (priority, updated_version) pair. + optional uint64 sort_version = 10; } message SyncedNotificationList { @@ -127,4 +143,65 @@ message Data { message ListData { repeated Data value = 1; +}; + +// The RenderContext encapsulates data about the device that is displaying the +// notification. In the future, RenderContext might include data like the +// location of the user. +message RenderContext { + // The type of the device. This will be used to decide the resolution as well + // as the size of the image returned with the response. + // The server will try to find the closest matching resource to use. + // The android densities are from + // http://developer.android.com/guide/practices/screens_support.html + enum DeviceType { + UNKNOWN = 0; + IOS_NON_RETINA = 1; + IOS_RETINA = 2; + ANDROID_MDPI = 3; + ANDROID_HDPI = 4; + ANDROID_XHDPI = 5; + ANDROID_TVDPI = 6; + DESKTOP_NON_RETINA = 7; + DESKTOP_RETINA = 8; + ANDROID_XXHDPI = 9; + CHROME_1X = 10; + CHROME_2X = 11; + } + + optional DeviceType device_type = 1; + + // The locale to render the notifications in. + optional string language_code = 2; +}; + +// List of AppIds and whether to treat the list as a Whitelist or Blacklist. +message AppList { + enum Type { + // Specified app_ids are supported. + WHITELIST = 1; + // Specified app_ids are not supported. + BLACKLIST = 2; + } + + // Whether to treat the app_id list as a Whitelist or Blacklist. + optional Type type = 1 [default = WHITELIST]; + + // List of AppIds. + repeated string app_id = 2; +}; + +message ServerContext { + // render_context encapsulates data about the device that is displaying the + // notifications. + optional RenderContext render_context = 1; + + // List of AppIds and whether it is a blacklist or whitelist. + // This field needs to be set only when the set of apps enabled on a client + // changes. In the server response, this field will get cleared. + optional AppList app_list = 2; + + // The view that the device has registered with. It is obtained from guns + // based on the app_list specified above. + optional string view_id = 3; }; \ No newline at end of file -- cgit v1.1