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