summaryrefslogtreecommitdiffstats
path: root/chromium/sync/protocol/synced_notification_render.proto
blob: 5ee073ed4f1c173d3d28d4f800a713da8e009be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
// any fields in this file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;
option retain_unknown_fields = true;

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 notification.
  optional CollapsedInfo collapsed_info = 1;

  // 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;

  // Defines a repeated list of meta tags that provide some context on what
  // this collapsed info is describing. Nothing about the display of this
  // collapsed info is defined by the meta tags.
  repeated string meta_tag = 5;
}

// 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;

  // A set of targets for actions the user can take, or destinations the
  // viewer can be taken to. These relate to the coalesced notification.
  repeated Target target = 3;

  // Enhanced context for the expanded view.
  repeated string meta_tag = 4;
}

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;

  // Media - one or more shared media items.
  repeated Media media = 5;

  // Annotation - often the annotation of the entity generating the
  // notification.
  optional string annotation = 6;
}

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 {
  // The description for the link to the destination.
  optional string text = 1;

  // The icon to use for the link to the destination.
  optional SyncedNotificationImage icon = 2;

  // The destination URL.
  optional string url = 3;

  // Optional label to aid accessibility.
  optional string accessibility_label = 4;
}

// An Action encapsulates an UI component that trigger certain programmable
// actions.  Depending on the endpoint, this may show up as a HTML button, an
// 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 icon to use for the Action.
  optional SyncedNotificationImage icon = 2;

  // The URL that performs the action.
  optional string url = 3;

  // Additional request data.
  optional string request_data = 4;

  // Optional label to aid accessibility.
  optional string accessibility_label= 5;

  // Defines a repeated list of meta tags that provide some context on this
  // action. Nothing about the display of this action is defined by the tags.
  repeated string meta_tag = 6;
}

message SyncedNotificationImage {
  // Note that the image may be from any source. Clients wishing to resize the
  // image should ensure the image is proxied appropriately.
  optional string url = 1;
  optional string alt_text = 2;
  optional int32 preferred_width = 3;
  optional int32 preferred_height = 4;
}

message SyncedNotificationProfileImage {
  // Url for the image.
  optional string image_url = 1;
  // Object id for the image.
  optional string oid = 2;
  // Name to display for this image.
  optional string display_name = 3;
}