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 // Sync protocol datatype extension for push notifications.. | 5 // Sync protocol datatype extension for push notifications.. |
6 | 6 |
7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change | 7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change |
8 // any fields in this file. | 8 // any fields in this file. |
9 | 9 |
10 syntax = "proto2"; | 10 syntax = "proto2"; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 // Data that is used directly by endpoints to render notifications in the case | 79 // Data that is used directly by endpoints to render notifications in the case |
80 // where no "native" app can handle the notification. | 80 // where no "native" app can handle the notification. |
81 optional SyncedNotificationRenderInfo render_info = 4; | 81 optional SyncedNotificationRenderInfo render_info = 4; |
82 | 82 |
83 // Read state will be per coalesced notification. | 83 // Read state will be per coalesced notification. |
84 enum ReadState { | 84 enum ReadState { |
85 UNREAD = 1; | 85 UNREAD = 1; |
86 READ = 2; | 86 READ = 2; |
87 DISMISSED = 3; | 87 DISMISSED = 3; |
| 88 SEEN = 4; |
88 } | 89 } |
89 optional ReadState read_state = 5; | 90 optional ReadState read_state = 5; |
90 | 91 |
91 // The time when the LATEST notification of the coalesced notification is | 92 // The time when the LATEST notification of the coalesced notification is |
92 // created (in milliseconds since the linux epoch). | 93 // created (in milliseconds since the linux epoch). |
| 94 // This is called updated_version in the server side protobuf. |
93 optional uint64 creation_time_msec = 6; | 95 optional uint64 creation_time_msec = 6; |
94 | 96 |
95 enum Priority { | 97 enum Priority { |
96 LOW = 1; | 98 INVISIBLE = 1; |
97 STANDARD = 2; | 99 LOW = 2; |
98 HIGH = 3; | 100 HIGH = 3; |
99 // We will most likely add at least one more priority in the near future. | 101 // We will most likely add at least one more priority in the near future. |
100 }; | 102 }; |
101 optional Priority priority = 7; | 103 optional Priority priority = 7; |
| 104 |
| 105 // Security token that is to be used when making a PerformUserAction request |
| 106 // when any user action within this coalesced notification is triggered. |
| 107 optional string user_action_token = 8; |
| 108 |
| 109 // This field corresponds to catchup_version in entity, which represents the |
| 110 // version entity was last modified. Note that the |
| 111 // Entity.last_modified_version will be actually the last creation version. |
| 112 // See comments in updated_version. |
| 113 optional uint64 last_modified_version = 9; |
| 114 |
| 115 // Clients should use this field to order the notifications. Currently this is |
| 116 // calculated from (priority, updated_version) pair. |
| 117 optional uint64 sort_version = 10; |
102 } | 118 } |
103 | 119 |
104 message SyncedNotificationList { | 120 message SyncedNotificationList { |
105 repeated CoalescedSyncedNotification coalesced_notification = 1; | 121 repeated CoalescedSyncedNotification coalesced_notification = 1; |
106 } | 122 } |
107 | 123 |
108 // MapData, Data, and ListData are used to sending aribitrary payloads | 124 // MapData, Data, and ListData are used to sending aribitrary payloads |
109 // between instances of applications using Synced Notifications. The | 125 // between instances of applications using Synced Notifications. The |
110 // schema atop MapData will be defined by the client application. | 126 // schema atop MapData will be defined by the client application. |
111 message MapData { | 127 message MapData { |
112 message Entry { | 128 message Entry { |
113 optional string key = 1; | 129 optional string key = 1; |
114 optional Data value = 2; | 130 optional Data value = 2; |
115 }; | 131 }; |
116 repeated Entry entry = 1; | 132 repeated Entry entry = 1; |
117 }; | 133 }; |
118 | 134 |
119 message Data { | 135 message Data { |
120 optional bool boolean_value = 1; | 136 optional bool boolean_value = 1; |
121 optional int32 int_value = 2; | 137 optional int32 int_value = 2; |
122 optional double float_value = 3; | 138 optional double float_value = 3; |
123 optional string string_value = 4; | 139 optional string string_value = 4; |
124 optional ListData list_value = 5; | 140 optional ListData list_value = 5; |
125 optional MapData map_value = 6; | 141 optional MapData map_value = 6; |
126 }; | 142 }; |
127 | 143 |
128 message ListData { | 144 message ListData { |
129 repeated Data value = 1; | 145 repeated Data value = 1; |
| 146 }; |
| 147 |
| 148 // The RenderContext encapsulates data about the device that is displaying the |
| 149 // notification. In the future, RenderContext might include data like the |
| 150 // location of the user. |
| 151 message RenderContext { |
| 152 // The type of the device. This will be used to decide the resolution as well |
| 153 // as the size of the image returned with the response. |
| 154 // The server will try to find the closest matching resource to use. |
| 155 // The android densities are from |
| 156 // http://developer.android.com/guide/practices/screens_support.html |
| 157 enum DeviceType { |
| 158 UNKNOWN = 0; |
| 159 IOS_NON_RETINA = 1; |
| 160 IOS_RETINA = 2; |
| 161 ANDROID_MDPI = 3; |
| 162 ANDROID_HDPI = 4; |
| 163 ANDROID_XHDPI = 5; |
| 164 ANDROID_TVDPI = 6; |
| 165 DESKTOP_NON_RETINA = 7; |
| 166 DESKTOP_RETINA = 8; |
| 167 ANDROID_XXHDPI = 9; |
| 168 CHROME_1X = 10; |
| 169 CHROME_2X = 11; |
| 170 } |
| 171 |
| 172 optional DeviceType device_type = 1; |
| 173 |
| 174 // The locale to render the notifications in. |
| 175 optional string language_code = 2; |
| 176 }; |
| 177 |
| 178 // List of AppIds and whether to treat the list as a Whitelist or Blacklist. |
| 179 message AppList { |
| 180 enum Type { |
| 181 // Specified app_ids are supported. |
| 182 WHITELIST = 1; |
| 183 // Specified app_ids are not supported. |
| 184 BLACKLIST = 2; |
| 185 } |
| 186 |
| 187 // Whether to treat the app_id list as a Whitelist or Blacklist. |
| 188 optional Type type = 1 [default = WHITELIST]; |
| 189 |
| 190 // List of AppIds. |
| 191 repeated string app_id = 2; |
| 192 }; |
| 193 |
| 194 message ServerContext { |
| 195 // render_context encapsulates data about the device that is displaying the |
| 196 // notifications. |
| 197 optional RenderContext render_context = 1; |
| 198 |
| 199 // List of AppIds and whether it is a blacklist or whitelist. |
| 200 // This field needs to be set only when the set of apps enabled on a client |
| 201 // changes. In the server response, this field will get cleared. |
| 202 optional AppList app_list = 2; |
| 203 |
| 204 // The view that the device has registered with. It is obtained from guns |
| 205 // based on the app_list specified above. |
| 206 optional string view_id = 3; |
130 }; | 207 }; |
OLD | NEW |