| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 const sync_pb::BookmarkSpecifics& proto) { | 305 const sync_pb::BookmarkSpecifics& proto) { |
| 306 base::DictionaryValue* value = new base::DictionaryValue(); | 306 base::DictionaryValue* value = new base::DictionaryValue(); |
| 307 SET_STR(url); | 307 SET_STR(url); |
| 308 SET_BYTES(favicon); | 308 SET_BYTES(favicon); |
| 309 SET_STR(title); | 309 SET_STR(title); |
| 310 SET_INT64(creation_time_us); | 310 SET_INT64(creation_time_us); |
| 311 SET_STR(icon_url); | 311 SET_STR(icon_url); |
| 312 return value; | 312 return value; |
| 313 } | 313 } |
| 314 | 314 |
| 315 base::DictionaryValue* PriorityPreferenceSpecificsToValue( | |
| 316 const sync_pb::PriorityPreferenceSpecifics& proto) { | |
| 317 base::DictionaryValue* value = new base::DictionaryValue(); | |
| 318 SET_STR(name); | |
| 319 SET_STR(value); | |
| 320 return value; | |
| 321 } | |
| 322 | |
| 323 base::DictionaryValue* DeviceInfoSpecificsToValue( | 315 base::DictionaryValue* DeviceInfoSpecificsToValue( |
| 324 const sync_pb::DeviceInfoSpecifics& proto) { | 316 const sync_pb::DeviceInfoSpecifics& proto) { |
| 325 base::DictionaryValue* value = new base::DictionaryValue(); | 317 base::DictionaryValue* value = new base::DictionaryValue(); |
| 326 SET_STR(cache_guid); | 318 SET_STR(cache_guid); |
| 327 SET_STR(client_name); | 319 SET_STR(client_name); |
| 328 SET_ENUM(device_type, GetDeviceTypeString); | 320 SET_ENUM(device_type, GetDeviceTypeString); |
| 329 SET_STR(sync_user_agent); | 321 SET_STR(sync_user_agent); |
| 330 SET_STR(chrome_version); | 322 SET_STR(chrome_version); |
| 331 return value; | 323 return value; |
| 332 } | 324 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } | 435 } |
| 444 | 436 |
| 445 base::DictionaryValue* PreferenceSpecificsToValue( | 437 base::DictionaryValue* PreferenceSpecificsToValue( |
| 446 const sync_pb::PreferenceSpecifics& proto) { | 438 const sync_pb::PreferenceSpecifics& proto) { |
| 447 base::DictionaryValue* value = new base::DictionaryValue(); | 439 base::DictionaryValue* value = new base::DictionaryValue(); |
| 448 SET_STR(name); | 440 SET_STR(name); |
| 449 SET_STR(value); | 441 SET_STR(value); |
| 450 return value; | 442 return value; |
| 451 } | 443 } |
| 452 | 444 |
| 445 base::DictionaryValue* PriorityPreferenceSpecificsToValue( |
| 446 const sync_pb::PriorityPreferenceSpecifics& specifics) { |
| 447 base::DictionaryValue* value = new base::DictionaryValue(); |
| 448 SET_FIELD(preference, PreferenceSpecificsToValue); |
| 449 return value; |
| 450 } |
| 451 |
| 453 base::DictionaryValue* SyncedNotificationSpecificsToValue( | 452 base::DictionaryValue* SyncedNotificationSpecificsToValue( |
| 454 const sync_pb::SyncedNotificationSpecifics& proto) { | 453 const sync_pb::SyncedNotificationSpecifics& proto) { |
| 455 base::DictionaryValue* value = new base::DictionaryValue(); | 454 base::DictionaryValue* value = new base::DictionaryValue(); |
| 456 // TODO(petewil): Adjust this once we add actual types in protobuf. | 455 // TODO(petewil): Adjust this once we add actual types in protobuf. |
| 457 return value; | 456 return value; |
| 458 } | 457 } |
| 459 | 458 |
| 460 base::DictionaryValue* SearchEngineSpecificsToValue( | 459 base::DictionaryValue* SearchEngineSpecificsToValue( |
| 461 const sync_pb::SearchEngineSpecifics& proto) { | 460 const sync_pb::SearchEngineSpecifics& proto) { |
| 462 base::DictionaryValue* value = new base::DictionaryValue(); | 461 base::DictionaryValue* value = new base::DictionaryValue(); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 #undef SET_BYTES | 794 #undef SET_BYTES |
| 796 #undef SET_INT32 | 795 #undef SET_INT32 |
| 797 #undef SET_INT64 | 796 #undef SET_INT64 |
| 798 #undef SET_INT64_REP | 797 #undef SET_INT64_REP |
| 799 #undef SET_STR | 798 #undef SET_STR |
| 800 #undef SET_STR_REP | 799 #undef SET_STR_REP |
| 801 | 800 |
| 802 #undef SET_FIELD | 801 #undef SET_FIELD |
| 803 | 802 |
| 804 } // namespace syncer | 803 } // namespace syncer |
| OLD | NEW |