| 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 "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 const sync_pb::BookmarkSpecifics& proto) { | 302 const sync_pb::BookmarkSpecifics& proto) { |
| 303 base::DictionaryValue* value = new base::DictionaryValue(); | 303 base::DictionaryValue* value = new base::DictionaryValue(); |
| 304 SET_STR(url); | 304 SET_STR(url); |
| 305 SET_BYTES(favicon); | 305 SET_BYTES(favicon); |
| 306 SET_STR(title); | 306 SET_STR(title); |
| 307 SET_INT64(creation_time_us); | 307 SET_INT64(creation_time_us); |
| 308 SET_STR(icon_url); | 308 SET_STR(icon_url); |
| 309 return value; | 309 return value; |
| 310 } | 310 } |
| 311 | 311 |
| 312 base::DictionaryValue* PriorityPreferenceSpecificsToValue( | |
| 313 const sync_pb::PriorityPreferenceSpecifics& proto) { | |
| 314 base::DictionaryValue* value = new base::DictionaryValue(); | |
| 315 SET_STR(name); | |
| 316 SET_STR(value); | |
| 317 return value; | |
| 318 } | |
| 319 | |
| 320 base::DictionaryValue* DeviceInfoSpecificsToValue( | 312 base::DictionaryValue* DeviceInfoSpecificsToValue( |
| 321 const sync_pb::DeviceInfoSpecifics& proto) { | 313 const sync_pb::DeviceInfoSpecifics& proto) { |
| 322 base::DictionaryValue* value = new base::DictionaryValue(); | 314 base::DictionaryValue* value = new base::DictionaryValue(); |
| 323 SET_STR(cache_guid); | 315 SET_STR(cache_guid); |
| 324 SET_STR(client_name); | 316 SET_STR(client_name); |
| 325 SET_ENUM(device_type, GetDeviceTypeString); | 317 SET_ENUM(device_type, GetDeviceTypeString); |
| 326 SET_STR(sync_user_agent); | 318 SET_STR(sync_user_agent); |
| 327 SET_STR(chrome_version); | 319 SET_STR(chrome_version); |
| 328 return value; | 320 return value; |
| 329 } | 321 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 } | 429 } |
| 438 | 430 |
| 439 base::DictionaryValue* PreferenceSpecificsToValue( | 431 base::DictionaryValue* PreferenceSpecificsToValue( |
| 440 const sync_pb::PreferenceSpecifics& proto) { | 432 const sync_pb::PreferenceSpecifics& proto) { |
| 441 base::DictionaryValue* value = new base::DictionaryValue(); | 433 base::DictionaryValue* value = new base::DictionaryValue(); |
| 442 SET_STR(name); | 434 SET_STR(name); |
| 443 SET_STR(value); | 435 SET_STR(value); |
| 444 return value; | 436 return value; |
| 445 } | 437 } |
| 446 | 438 |
| 439 base::DictionaryValue* PriorityPreferenceSpecificsToValue( |
| 440 const sync_pb::PriorityPreferenceSpecifics& specifics) { |
| 441 base::DictionaryValue* value = new base::DictionaryValue(); |
| 442 SET_FIELD(preference, PreferenceSpecificsToValue); |
| 443 return value; |
| 444 } |
| 445 |
| 447 base::DictionaryValue* SyncedNotificationSpecificsToValue( | 446 base::DictionaryValue* SyncedNotificationSpecificsToValue( |
| 448 const sync_pb::SyncedNotificationSpecifics& proto) { | 447 const sync_pb::SyncedNotificationSpecifics& proto) { |
| 449 base::DictionaryValue* value = new base::DictionaryValue(); | 448 base::DictionaryValue* value = new base::DictionaryValue(); |
| 450 // TODO(petewil): Adjust this once we add actual types in protobuf. | 449 // TODO(petewil): Adjust this once we add actual types in protobuf. |
| 451 return value; | 450 return value; |
| 452 } | 451 } |
| 453 | 452 |
| 454 base::DictionaryValue* SearchEngineSpecificsToValue( | 453 base::DictionaryValue* SearchEngineSpecificsToValue( |
| 455 const sync_pb::SearchEngineSpecifics& proto) { | 454 const sync_pb::SearchEngineSpecifics& proto) { |
| 456 base::DictionaryValue* value = new base::DictionaryValue(); | 455 base::DictionaryValue* value = new base::DictionaryValue(); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 #undef SET_BYTES | 786 #undef SET_BYTES |
| 788 #undef SET_INT32 | 787 #undef SET_INT32 |
| 789 #undef SET_INT64 | 788 #undef SET_INT64 |
| 790 #undef SET_INT64_REP | 789 #undef SET_INT64_REP |
| 791 #undef SET_STR | 790 #undef SET_STR |
| 792 #undef SET_STR_REP | 791 #undef SET_STR_REP |
| 793 | 792 |
| 794 #undef SET_FIELD | 793 #undef SET_FIELD |
| 795 | 794 |
| 796 } // namespace syncer | 795 } // namespace syncer |
| OLD | NEW |