summaryrefslogtreecommitdiffstats
path: root/sync/protocol
diff options
context:
space:
mode:
authorpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 20:58:55 +0000
committerpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 20:58:55 +0000
commit3e419d6725611bb0309ba5ef5792fe81d71b7c1b (patch)
treea2264253b8a5d8396e93af5779cf5b9aaa2e931d /sync/protocol
parent50761e91bb7255a901c66d1336612ce40a75728b (diff)
downloadchromium_src-3e419d6725611bb0309ba5ef5792fe81d71b7c1b.zip
chromium_src-3e419d6725611bb0309ba5ef5792fe81d71b7c1b.tar.gz
chromium_src-3e419d6725611bb0309ba5ef5792fe81d71b7c1b.tar.bz2
Widen the data pipes between Synced Notifications and Rich Notifications
Update to the latest protobufs, rearranging them for maintainability. Id has been changed to Key everywhere. DefaultDestination fields added. Message_type now used. First external id removed. Functions added for buttons button count and notification count Button action fields added. Added new accessors for time priority, and button data, and associated tests We now use Dismissed instead of Read for setting a notification state. Adapt to the newer protobufs from the server side for synced notifications BUG=222077 Review URL: https://chromiumcodereview.appspot.com/12717010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191443 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/protocol')
-rw-r--r--sync/protocol/synced_notification_data.proto30
-rw-r--r--sync/protocol/synced_notification_render.proto143
2 files changed, 108 insertions, 65 deletions
diff --git a/sync/protocol/synced_notification_data.proto b/sync/protocol/synced_notification_data.proto
index fed7ee7..72c612d 100644
--- a/sync/protocol/synced_notification_data.proto
+++ b/sync/protocol/synced_notification_data.proto
@@ -63,8 +63,8 @@ message SyncedNotification {
// The creator of the notification.
optional SyncedNotificationCreator creator = 3;
- // TODO(petewil): This won't build. Import the relevant protobuf.
- // optional MapData client_data = 4;
+ // Client specific data.
+ optional MapData client_data = 4;
}
message CoalescedSyncedNotification {
@@ -103,4 +103,28 @@ message CoalescedSyncedNotification {
message SyncedNotificationList {
repeated CoalescedSyncedNotification coalesced_notification = 1;
-} \ No newline at end of file
+}
+
+// MapData, Data, and ListData are used to sending aribitrary payloads
+// between instances of applications using Synced Notifications. The
+// schema atop MapData will be defined by the client application.
+message MapData {
+ message Entry {
+ optional string key = 1;
+ optional Data value = 2;
+ };
+ repeated Entry entry = 1;
+};
+
+message Data {
+ optional bool boolean_value = 1;
+ optional int32 int_value = 2;
+ optional double float_value = 3;
+ optional string string_value = 4;
+ optional ListData list_value = 5;
+ optional MapData map_value = 6;
+};
+
+message ListData {
+ repeated Data value = 1;
+}; \ No newline at end of file
diff --git a/sync/protocol/synced_notification_render.proto b/sync/protocol/synced_notification_render.proto
index ce5a721..46d890f 100644
--- a/sync/protocol/synced_notification_render.proto
+++ b/sync/protocol/synced_notification_render.proto
@@ -16,70 +16,89 @@ package sync_pb;
// Data that is used directly by endpoints to render notifications in the case
// where no "native" app can handle the notification.
message SyncedNotificationRenderInfo {
-
- // Render information for the collapsed (summary) view of a coalesced
- // notification.
- message CollapsedInfo {
- message SimpleCollapsedLayout {
- // Application icon.
- optional SyncedNotificationImage app_icon = 1;
-
- // Profile image(s) of the notification creator(s) to show in the
- // collapsed UI.
- repeated SyncedNotificationProfileImage profile_image = 2;
-
- // Heading - often the name(s) of the notification creator(s).
- optional string heading = 3;
-
- // Description - often the action that generated the notification.
- optional string description = 4;
- }
- optional SimpleCollapsedLayout simple_collapsed_layout = 1;
-
- // The creation time of the notification in microseconds since the UNIX
- // epoch.
- optional uint64 creation_timestamp_usec = 2;
-
- // The default destination target.
- optional SyncedNotificationDestination default_destination = 3;
-
- // Secondary destinations and actions grouped into a message to account for
- // ordering.
- message Target {
- optional SyncedNotificationDestination destination = 1;
- optional SyncedNotificationAction action = 2;
- }
- repeated Target target = 4;
- }
+ // Render information for the collapsed (summary) view of a notification.
optional CollapsedInfo collapsed_info = 1;
- // Render information for the expanded (detail) view of a coalesced
- // notification.
- message ExpandedInfo {
- message SimpleExpandedLayout {
- // Title - often the title of the underlying entity referred to by the
- // notification(s).
- optional string title = 1;
-
- // Text content - often a snippet of text from the underlying entity
- // reference or the notification.
- optional string text = 2;
-
- // Media.
- message Media {
- // TOOD(jro): Do we need other media types?
- optional SyncedNotificationImage image = 1;
- }
- repeated Media media = 3;
- }
- optional SimpleExpandedLayout simple_expanded_layout = 1;
-
- // Collapsed information for each notification in the coalesced group.
- repeated CollapsedInfo collapsed_info = 2;
- }
+ // Render information for the expanded view of a notification.
optional ExpandedInfo expanded_info = 2;
}
+// Render information for the collapsed (summary) view of a coalesced
+// notification.
+message CollapsedInfo {
+ optional SimpleCollapsedLayout simple_collapsed_layout = 1;
+
+ // The creation time of the notification in microseconds since the UNIX
+ // epoch.
+ optional uint64 creation_timestamp_usec = 2;
+
+ // The default destination target.
+ optional SyncedNotificationDestination default_destination = 3;
+
+ repeated Target target = 4;
+}
+
+// Render information for the expanded (detail) view of a coalesced
+// notification.
+message ExpandedInfo {
+ optional SimpleExpandedLayout simple_expanded_layout = 1;
+
+ // Collapsed information for each notification in the coalesced group.
+ repeated CollapsedInfo collapsed_info = 2;
+}
+
+message SimpleCollapsedLayout {
+ // Application icon.
+ optional SyncedNotificationImage app_icon = 1;
+
+ // Profile image(s) of the notification creator(s) to show in the
+ // collapsed UI.
+ repeated SyncedNotificationProfileImage profile_image = 2;
+
+ // Heading - often the name(s) of the notification creator(s).
+ optional string heading = 3;
+
+ // Description - often the action that generated the notification.
+ optional string description = 4;
+}
+
+message SimpleExpandedLayout {
+ // Title - often the title of the underlying entity referred to by the
+ // notification(s).
+ optional string title = 1;
+
+ // Text content - often a snippet of text from the underlying entity
+ // reference or the notification.
+ optional string text = 2;
+
+ repeated Media media = 3;
+
+ // Profile image, usually this is the creator of the referenced entity.
+ optional SyncedNotificationProfileImage profile_image = 4;
+
+ // A set of targets for actions the user can take, or destinations the
+ // viewer can be taken to. Usually these relate to the referenced entity.
+ repeated Target target = 5;
+}
+
+// Media.
+message Media {
+ // TOOD(jro): Do we need other media types?
+ optional SyncedNotificationImage image = 1;
+}
+
+// Secondary destinations and actions grouped into a message to account for
+// ordering.
+message Target {
+ // URL that the user will be taken to by clicking on the notification.
+ optional SyncedNotificationDestination destination = 1;
+ // URI to POST if the user clicks on a button.
+ optional SyncedNotificationAction action = 2;
+
+ // A key to identify this target within a group of targets.
+ optional string target_key = 3;
+}
+
// A Destination is a target URL that the user can be taken to by clicking on or
// selecting the notification or part thereof.
message SyncedNotificationDestination {
@@ -101,8 +120,8 @@ message SyncedNotificationDestination {
// action button associated with the notification on native mobile, a link, or
// even the notification card itself.
message SyncedNotificationAction {
- // The description for the Action.
- optional string text = 1;
+ // The description for the Action.
+ optional string text = 1;
// The icon to use for the Action.
optional SyncedNotificationImage icon = 2;
@@ -133,4 +152,4 @@ message SyncedNotificationProfileImage {
optional string oid = 2;
// Name to display for this image.
optional string display_name = 3;
-} \ No newline at end of file
+}