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 // Keep this file in sync with the .proto files in this directory. | 5 // Keep this file in sync with the .proto files in this directory. |
6 | 6 |
7 #include "sync/protocol/proto_value_conversions.h" | 7 #include "sync/protocol/proto_value_conversions.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 233 } |
234 | 234 |
235 base::DictionaryValue* TimeRangeDirectiveToValue( | 235 base::DictionaryValue* TimeRangeDirectiveToValue( |
236 const sync_pb::TimeRangeDirective& proto) { | 236 const sync_pb::TimeRangeDirective& proto) { |
237 base::DictionaryValue* value = new base::DictionaryValue(); | 237 base::DictionaryValue* value = new base::DictionaryValue(); |
238 SET_INT64(start_time_usec); | 238 SET_INT64(start_time_usec); |
239 SET_INT64(end_time_usec); | 239 SET_INT64(end_time_usec); |
240 return value; | 240 return value; |
241 } | 241 } |
242 | 242 |
| 243 base::DictionaryValue* SyncedNotificationImageToValue( |
| 244 const sync_pb::SyncedNotificationImage& proto) { |
| 245 base::DictionaryValue* value = new base::DictionaryValue(); |
| 246 SET_STR(url); |
| 247 return value; |
| 248 } |
| 249 |
| 250 base::DictionaryValue* SyncedNotificationProfileImageToValue( |
| 251 const sync_pb::SyncedNotificationProfileImage& proto) { |
| 252 base::DictionaryValue* value = new base::DictionaryValue(); |
| 253 SET_STR(image_url); |
| 254 return value; |
| 255 } |
| 256 |
| 257 base::DictionaryValue* MediaToValue( |
| 258 const sync_pb::Media& proto) { |
| 259 base::DictionaryValue* value = new base::DictionaryValue(); |
| 260 SET(image, SyncedNotificationImageToValue); |
| 261 return value; |
| 262 } |
| 263 |
243 base::DictionaryValue* SimpleCollapsedLayoutToValue( | 264 base::DictionaryValue* SimpleCollapsedLayoutToValue( |
244 const sync_pb::SimpleCollapsedLayout& proto) { | 265 const sync_pb::SimpleCollapsedLayout& proto) { |
245 base::DictionaryValue* value = new base::DictionaryValue(); | 266 base::DictionaryValue* value = new base::DictionaryValue(); |
246 SET_STR(heading); | 267 SET_STR(heading); |
247 SET_STR(description); | 268 SET_STR(description); |
| 269 SET_STR(annotation); |
| 270 SET_REP(media, MediaToValue); |
| 271 SET_REP(profile_image, SyncedNotificationProfileImageToValue); |
| 272 SET(app_icon, SyncedNotificationImageToValue); |
248 return value; | 273 return value; |
249 } | 274 } |
250 | 275 |
251 base::DictionaryValue* CollapsedInfoToValue( | 276 base::DictionaryValue* CollapsedInfoToValue( |
252 const sync_pb::CollapsedInfo& proto) { | 277 const sync_pb::CollapsedInfo& proto) { |
253 base::DictionaryValue* value = new base::DictionaryValue(); | 278 base::DictionaryValue* value = new base::DictionaryValue(); |
254 SET(simple_collapsed_layout, SimpleCollapsedLayoutToValue); | 279 SET(simple_collapsed_layout, SimpleCollapsedLayoutToValue); |
255 return value; | 280 return value; |
256 } | 281 } |
257 | 282 |
258 base::DictionaryValue* RenderInfoToValue( | 283 base::DictionaryValue* RenderInfoToValue( |
259 const sync_pb::SyncedNotificationRenderInfo& proto) { | 284 const sync_pb::SyncedNotificationRenderInfo& proto) { |
260 base::DictionaryValue* value = new base::DictionaryValue(); | 285 base::DictionaryValue* value = new base::DictionaryValue(); |
| 286 // TODO(petewil): Add the expanded info values too. |
261 SET(collapsed_info, CollapsedInfoToValue); | 287 SET(collapsed_info, CollapsedInfoToValue); |
262 return value; | 288 return value; |
263 } | 289 } |
264 | 290 |
265 base::DictionaryValue* CoalescedNotificationToValue( | 291 base::DictionaryValue* CoalescedNotificationToValue( |
266 const sync_pb::CoalescedSyncedNotification& proto) { | 292 const sync_pb::CoalescedSyncedNotification& proto) { |
267 base::DictionaryValue* value = new base::DictionaryValue(); | 293 base::DictionaryValue* value = new base::DictionaryValue(); |
268 SET_STR(key); | 294 SET_STR(key); |
269 SET_INT32(read_state); | 295 SET_INT32(read_state); |
| 296 SET_INT64(creation_time_msec); |
| 297 SET_INT32(priority); |
270 SET(render_info, RenderInfoToValue); | 298 SET(render_info, RenderInfoToValue); |
271 return value; | 299 return value; |
272 } | 300 } |
273 | 301 |
274 base::DictionaryValue* AppNotificationToValue( | 302 base::DictionaryValue* AppNotificationToValue( |
275 const sync_pb::AppNotification& proto) { | 303 const sync_pb::AppNotification& proto) { |
276 base::DictionaryValue* value = new base::DictionaryValue(); | 304 base::DictionaryValue* value = new base::DictionaryValue(); |
277 SET_STR(guid); | 305 SET_STR(guid); |
278 SET_STR(app_id); | 306 SET_STR(app_id); |
279 SET_INT64(creation_timestamp_ms); | 307 SET_INT64(creation_timestamp_ms); |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 #undef SET_BYTES | 926 #undef SET_BYTES |
899 #undef SET_INT32 | 927 #undef SET_INT32 |
900 #undef SET_INT64 | 928 #undef SET_INT64 |
901 #undef SET_INT64_REP | 929 #undef SET_INT64_REP |
902 #undef SET_STR | 930 #undef SET_STR |
903 #undef SET_STR_REP | 931 #undef SET_STR_REP |
904 | 932 |
905 #undef SET_FIELD | 933 #undef SET_FIELD |
906 | 934 |
907 } // namespace syncer | 935 } // namespace syncer |
OLD | NEW |