| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 | 5 |
| 6 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change | 6 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change |
| 7 // any fields in this file. | 7 // any fields in this file. |
| 8 | 8 |
| 9 syntax = "proto2"; | 9 syntax = "proto2"; |
| 10 | 10 |
| 11 option optimize_for = LITE_RUNTIME; | 11 option optimize_for = LITE_RUNTIME; |
| 12 option retain_unknown_fields = true; | 12 option retain_unknown_fields = true; |
| 13 | 13 |
| 14 package sync_pb; | 14 package sync_pb; |
| 15 | 15 |
| 16 // Data that is used directly by endpoints to render notifications in the case | 16 // Data that is used directly by endpoints to render notifications in the case |
| 17 // where no "native" app can handle the notification. | 17 // where no "native" app can handle the notification. |
| 18 message SyncedNotificationRenderInfo { | 18 message SyncedNotificationRenderInfo { |
| 19 | 19 // Render information for the collapsed (summary) view of a notification. |
| 20 // Render information for the collapsed (summary) view of a coalesced | |
| 21 // notification. | |
| 22 message CollapsedInfo { | |
| 23 message SimpleCollapsedLayout { | |
| 24 // Application icon. | |
| 25 optional SyncedNotificationImage app_icon = 1; | |
| 26 | |
| 27 // Profile image(s) of the notification creator(s) to show in the | |
| 28 // collapsed UI. | |
| 29 repeated SyncedNotificationProfileImage profile_image = 2; | |
| 30 | |
| 31 // Heading - often the name(s) of the notification creator(s). | |
| 32 optional string heading = 3; | |
| 33 | |
| 34 // Description - often the action that generated the notification. | |
| 35 optional string description = 4; | |
| 36 } | |
| 37 optional SimpleCollapsedLayout simple_collapsed_layout = 1; | |
| 38 | |
| 39 // The creation time of the notification in microseconds since the UNIX | |
| 40 // epoch. | |
| 41 optional uint64 creation_timestamp_usec = 2; | |
| 42 | |
| 43 // The default destination target. | |
| 44 optional SyncedNotificationDestination default_destination = 3; | |
| 45 | |
| 46 // Secondary destinations and actions grouped into a message to account for | |
| 47 // ordering. | |
| 48 message Target { | |
| 49 optional SyncedNotificationDestination destination = 1; | |
| 50 optional SyncedNotificationAction action = 2; | |
| 51 } | |
| 52 repeated Target target = 4; | |
| 53 } | |
| 54 optional CollapsedInfo collapsed_info = 1; | 20 optional CollapsedInfo collapsed_info = 1; |
| 55 | 21 |
| 56 // Render information for the expanded (detail) view of a coalesced | 22 // Render information for the expanded view of a notification. |
| 57 // notification. | 23 optional ExpandedInfo expanded_info = 2; |
| 58 message ExpandedInfo { | 24 } |
| 59 message SimpleExpandedLayout { | |
| 60 // Title - often the title of the underlying entity referred to by the | |
| 61 // notification(s). | |
| 62 optional string title = 1; | |
| 63 | 25 |
| 64 // Text content - often a snippet of text from the underlying entity | 26 // Render information for the collapsed (summary) view of a coalesced |
| 65 // reference or the notification. | 27 // notification. |
| 66 optional string text = 2; | 28 message CollapsedInfo { |
| 29 optional SimpleCollapsedLayout simple_collapsed_layout = 1; |
| 67 | 30 |
| 68 // Media. | 31 // The creation time of the notification in microseconds since the UNIX |
| 69 message Media { | 32 // epoch. |
| 70 // TOOD(jro): Do we need other media types? | 33 optional uint64 creation_timestamp_usec = 2; |
| 71 optional SyncedNotificationImage image = 1; | |
| 72 } | |
| 73 repeated Media media = 3; | |
| 74 } | |
| 75 optional SimpleExpandedLayout simple_expanded_layout = 1; | |
| 76 | 34 |
| 77 // Collapsed information for each notification in the coalesced group. | 35 // The default destination target. |
| 78 repeated CollapsedInfo collapsed_info = 2; | 36 optional SyncedNotificationDestination default_destination = 3; |
| 79 } | 37 |
| 80 optional ExpandedInfo expanded_info = 2; | 38 repeated Target target = 4; |
| 39 } |
| 40 |
| 41 // Render information for the expanded (detail) view of a coalesced |
| 42 // notification. |
| 43 message ExpandedInfo { |
| 44 optional SimpleExpandedLayout simple_expanded_layout = 1; |
| 45 |
| 46 // Collapsed information for each notification in the coalesced group. |
| 47 repeated CollapsedInfo collapsed_info = 2; |
| 48 } |
| 49 |
| 50 message SimpleCollapsedLayout { |
| 51 // Application icon. |
| 52 optional SyncedNotificationImage app_icon = 1; |
| 53 |
| 54 // Profile image(s) of the notification creator(s) to show in the |
| 55 // collapsed UI. |
| 56 repeated SyncedNotificationProfileImage profile_image = 2; |
| 57 |
| 58 // Heading - often the name(s) of the notification creator(s). |
| 59 optional string heading = 3; |
| 60 |
| 61 // Description - often the action that generated the notification. |
| 62 optional string description = 4; |
| 63 } |
| 64 |
| 65 message SimpleExpandedLayout { |
| 66 // Title - often the title of the underlying entity referred to by the |
| 67 // notification(s). |
| 68 optional string title = 1; |
| 69 |
| 70 // Text content - often a snippet of text from the underlying entity |
| 71 // reference or the notification. |
| 72 optional string text = 2; |
| 73 |
| 74 repeated Media media = 3; |
| 75 |
| 76 // Profile image, usually this is the creator of the referenced entity. |
| 77 optional SyncedNotificationProfileImage profile_image = 4; |
| 78 |
| 79 // A set of targets for actions the user can take, or destinations the |
| 80 // viewer can be taken to. Usually these relate to the referenced entity. |
| 81 repeated Target target = 5; |
| 82 } |
| 83 |
| 84 // Media. |
| 85 message Media { |
| 86 // TOOD(jro): Do we need other media types? |
| 87 optional SyncedNotificationImage image = 1; |
| 88 } |
| 89 |
| 90 // Secondary destinations and actions grouped into a message to account for |
| 91 // ordering. |
| 92 message Target { |
| 93 // URL that the user will be taken to by clicking on the notification. |
| 94 optional SyncedNotificationDestination destination = 1; |
| 95 // URI to POST if the user clicks on a button. |
| 96 optional SyncedNotificationAction action = 2; |
| 97 |
| 98 // A key to identify this target within a group of targets. |
| 99 optional string target_key = 3; |
| 81 } | 100 } |
| 82 | 101 |
| 83 // A Destination is a target URL that the user can be taken to by clicking on or | 102 // A Destination is a target URL that the user can be taken to by clicking on or |
| 84 // selecting the notification or part thereof. | 103 // selecting the notification or part thereof. |
| 85 message SyncedNotificationDestination { | 104 message SyncedNotificationDestination { |
| 86 // The description for the link to the destination. | 105 // The description for the link to the destination. |
| 87 optional string text = 1; | 106 optional string text = 1; |
| 88 | 107 |
| 89 // The icon to use for the link to the destination. | 108 // The icon to use for the link to the destination. |
| 90 optional SyncedNotificationImage icon = 2; | 109 optional SyncedNotificationImage icon = 2; |
| 91 | 110 |
| 92 // The destination URL. | 111 // The destination URL. |
| 93 optional string url = 3; | 112 optional string url = 3; |
| 94 | 113 |
| 95 // Optional label to aid accessibility. | 114 // Optional label to aid accessibility. |
| 96 optional string accessibility_label = 4; | 115 optional string accessibility_label = 4; |
| 97 } | 116 } |
| 98 | 117 |
| 99 // An Action encapsulates an UI component that trigger certain programmable | 118 // An Action encapsulates an UI component that trigger certain programmable |
| 100 // actions. Depending on the endpoint, this may show up as a HTML button, an | 119 // actions. Depending on the endpoint, this may show up as a HTML button, an |
| 101 // action button associated with the notification on native mobile, a link, or | 120 // action button associated with the notification on native mobile, a link, or |
| 102 // even the notification card itself. | 121 // even the notification card itself. |
| 103 message SyncedNotificationAction { | 122 message SyncedNotificationAction { |
| 104 // The description for the Action. | 123 // The description for the Action. |
| 105 optional string text = 1; | 124 optional string text = 1; |
| 106 | 125 |
| 107 // The icon to use for the Action. | 126 // The icon to use for the Action. |
| 108 optional SyncedNotificationImage icon = 2; | 127 optional SyncedNotificationImage icon = 2; |
| 109 | 128 |
| 110 // The URL that performs the action. | 129 // The URL that performs the action. |
| 111 optional string url = 3; | 130 optional string url = 3; |
| 112 | 131 |
| 113 // Additional request data. | 132 // Additional request data. |
| 114 optional string request_data = 4; | 133 optional string request_data = 4; |
| 115 | 134 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 126 optional int32 preferred_height = 4; | 145 optional int32 preferred_height = 4; |
| 127 } | 146 } |
| 128 | 147 |
| 129 message SyncedNotificationProfileImage { | 148 message SyncedNotificationProfileImage { |
| 130 // Url for the image. | 149 // Url for the image. |
| 131 optional string image_url = 1; | 150 optional string image_url = 1; |
| 132 // Object id for the image. | 151 // Object id for the image. |
| 133 optional string oid = 2; | 152 optional string oid = 2; |
| 134 // Name to display for this image. | 153 // Name to display for this image. |
| 135 optional string display_name = 3; | 154 optional string display_name = 3; |
| 136 } | 155 } |
| OLD | NEW |