Roll gyp r1967:1970.
[chromium-blink-merge.git] / sync / protocol / synced_notification_render.proto
blob5ee073ed4f1c173d3d28d4f800a713da8e009be1
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
3 // found in the LICENSE file.
4 //
6 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
7 // any fields in this file.
9 syntax = "proto2";
11 option optimize_for = LITE_RUNTIME;
12 option retain_unknown_fields = true;
14 package sync_pb;
16 // Data that is used directly by endpoints to render notifications in the case
17 // where no "native" app can handle the notification.
18 message SyncedNotificationRenderInfo {
19   // Render information for the collapsed (summary) view of a notification.
20   optional CollapsedInfo collapsed_info = 1;
22   // Render information for the expanded view of a notification.
23   optional ExpandedInfo expanded_info = 2;
26 // Render information for the collapsed (summary) view of a coalesced
27 // notification.
28 message CollapsedInfo {
29   optional SimpleCollapsedLayout simple_collapsed_layout = 1;
31   // The creation time of the notification in microseconds since the UNIX
32   // epoch.
33   optional uint64 creation_timestamp_usec = 2;
35   // The default destination target.
36   optional SyncedNotificationDestination default_destination = 3;
38   repeated Target target = 4;
40   // Defines a repeated list of meta tags that provide some context on what
41   // this collapsed info is describing. Nothing about the display of this
42   // collapsed info is defined by the meta tags.
43   repeated string meta_tag = 5;
46 // Render information for the expanded (detail) view of a coalesced
47 // notification.
48 message ExpandedInfo {
49   optional SimpleExpandedLayout simple_expanded_layout = 1;
51   // Collapsed information for each notification in the coalesced group.
52   repeated CollapsedInfo collapsed_info = 2;
54   // A set of targets for actions the user can take, or destinations the
55   // viewer can be taken to. These relate to the coalesced notification.
56   repeated Target target = 3;
58   // Enhanced context for the expanded view.
59   repeated string meta_tag = 4;
62 message SimpleCollapsedLayout {
63   // Application icon.
64   optional SyncedNotificationImage app_icon = 1;
66   // Profile image(s) of the notification creator(s) to show in the
67   // collapsed UI.
68   repeated SyncedNotificationProfileImage profile_image = 2;
70   // Heading - often the name(s) of the notification creator(s).
71   optional string heading = 3;
73   // Description - often the action that generated the notification.
74   optional string description = 4;
76   // Media - one or more shared media items.
77   repeated Media media = 5;
79   // Annotation - often the annotation of the entity generating the
80   // notification.
81   optional string annotation = 6;
84 message SimpleExpandedLayout {
85   // Title - often the title of the underlying entity referred to by the
86   // notification(s).
87   optional string title = 1;
89   // Text content - often a snippet of text from the underlying entity
90   // reference or the notification.
91   optional string text = 2;
93   repeated Media media = 3;
95   // Profile image, usually this is the creator of the referenced entity.
96   optional SyncedNotificationProfileImage profile_image = 4;
98   // A set of targets for actions the user can take, or destinations the
99   // viewer can be taken to. Usually these relate to the referenced entity.
100   repeated Target target = 5;
103 // Media.
104 message Media {
105   // TOOD(jro): Do we need other media types?
106   optional SyncedNotificationImage image = 1;
109 // Secondary destinations and actions grouped into a message to account for
110 // ordering.
111 message Target {
112   // URL that the user will be taken to by clicking on the notification.
113   optional SyncedNotificationDestination destination = 1;
114   // URI to POST if the user clicks on a button.
115   optional SyncedNotificationAction action = 2;
117   // A key to identify this target within a group of targets.
118   optional string target_key = 3;
121 // A Destination is a target URL that the user can be taken to by clicking on or
122 // selecting the notification or part thereof.
123 message SyncedNotificationDestination {
124   // The description for the link to the destination.
125   optional string text = 1;
127   // The icon to use for the link to the destination.
128   optional SyncedNotificationImage icon = 2;
130   // The destination URL.
131   optional string url = 3;
133   // Optional label to aid accessibility.
134   optional string accessibility_label = 4;
137 // An Action encapsulates an UI component that trigger certain programmable
138 // actions.  Depending on the endpoint, this may show up as a HTML button, an
139 // action button associated with the notification on native mobile, a link, or
140 // even the notification card itself.
141 message SyncedNotificationAction {
142   // The description for the Action.
143   optional string text = 1;
145   // The icon to use for the Action.
146   optional SyncedNotificationImage icon = 2;
148   // The URL that performs the action.
149   optional string url = 3;
151   // Additional request data.
152   optional string request_data = 4;
154   // Optional label to aid accessibility.
155   optional string accessibility_label= 5;
157   // Defines a repeated list of meta tags that provide some context on this
158   // action. Nothing about the display of this action is defined by the tags.
159   repeated string meta_tag = 6;
162 message SyncedNotificationImage {
163   // Note that the image may be from any source. Clients wishing to resize the
164   // image should ensure the image is proxied appropriately.
165   optional string url = 1;
166   optional string alt_text = 2;
167   optional int32 preferred_width = 3;
168   optional int32 preferred_height = 4;
171 message SyncedNotificationProfileImage {
172   // Url for the image.
173   optional string image_url = 1;
174   // Object id for the image.
175   optional string oid = 2;
176   // Name to display for this image.
177   optional string display_name = 3;