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 "components/sync/protocol/proto_value_conversions.h" | 7 #include "components/sync/protocol/proto_value_conversions.h" |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "components/sync/protocol/encryption.pb.h" | 31 #include "components/sync/protocol/encryption.pb.h" |
32 #include "components/sync/protocol/experiments_specifics.pb.h" | 32 #include "components/sync/protocol/experiments_specifics.pb.h" |
33 #include "components/sync/protocol/extension_setting_specifics.pb.h" | 33 #include "components/sync/protocol/extension_setting_specifics.pb.h" |
34 #include "components/sync/protocol/extension_specifics.pb.h" | 34 #include "components/sync/protocol/extension_specifics.pb.h" |
35 #include "components/sync/protocol/favicon_image_specifics.pb.h" | 35 #include "components/sync/protocol/favicon_image_specifics.pb.h" |
36 #include "components/sync/protocol/favicon_tracking_specifics.pb.h" | 36 #include "components/sync/protocol/favicon_tracking_specifics.pb.h" |
37 #include "components/sync/protocol/history_delete_directive_specifics.pb.h" | 37 #include "components/sync/protocol/history_delete_directive_specifics.pb.h" |
38 #include "components/sync/protocol/nigori_specifics.pb.h" | 38 #include "components/sync/protocol/nigori_specifics.pb.h" |
39 #include "components/sync/protocol/password_specifics.pb.h" | 39 #include "components/sync/protocol/password_specifics.pb.h" |
40 #include "components/sync/protocol/preference_specifics.pb.h" | 40 #include "components/sync/protocol/preference_specifics.pb.h" |
| 41 #include "components/sync/protocol/printer_specifics.pb.h" |
41 #include "components/sync/protocol/priority_preference_specifics.pb.h" | 42 #include "components/sync/protocol/priority_preference_specifics.pb.h" |
42 #include "components/sync/protocol/proto_enum_conversions.h" | 43 #include "components/sync/protocol/proto_enum_conversions.h" |
43 #include "components/sync/protocol/search_engine_specifics.pb.h" | 44 #include "components/sync/protocol/search_engine_specifics.pb.h" |
44 #include "components/sync/protocol/session_specifics.pb.h" | 45 #include "components/sync/protocol/session_specifics.pb.h" |
45 #include "components/sync/protocol/sync.pb.h" | 46 #include "components/sync/protocol/sync.pb.h" |
46 #include "components/sync/protocol/theme_specifics.pb.h" | 47 #include "components/sync/protocol/theme_specifics.pb.h" |
47 #include "components/sync/protocol/typed_url_specifics.pb.h" | 48 #include "components/sync/protocol/typed_url_specifics.pb.h" |
48 #include "components/sync/protocol/unique_position.pb.h" | 49 #include "components/sync/protocol/unique_position.pb.h" |
49 | 50 |
50 namespace syncer { | 51 namespace syncer { |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 const sync_pb::ArcPackageSpecifics& proto) { | 282 const sync_pb::ArcPackageSpecifics& proto) { |
282 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 283 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
283 SET_STR(package_name); | 284 SET_STR(package_name); |
284 SET_INT32(package_version); | 285 SET_INT32(package_version); |
285 SET_INT64(last_backup_android_id); | 286 SET_INT64(last_backup_android_id); |
286 SET_INT64(last_backup_time); | 287 SET_INT64(last_backup_time); |
287 | 288 |
288 return value; | 289 return value; |
289 } | 290 } |
290 | 291 |
| 292 std::unique_ptr<base::DictionaryValue> PrinterPPDDataToValue( |
| 293 const sync_pb::PrinterPPDData& proto) { |
| 294 std::unique_ptr<base::DictionaryValue> value = |
| 295 base::MakeUnique<base::DictionaryValue>(); |
| 296 SET_INT32(id); |
| 297 SET_STR(file_name); |
| 298 SET_INT64(version_number); |
| 299 SET_BOOL(from_quirks_server); |
| 300 return value; |
| 301 } |
| 302 |
291 std::unique_ptr<base::DictionaryValue> AppNotificationToValue( | 303 std::unique_ptr<base::DictionaryValue> AppNotificationToValue( |
292 const sync_pb::AppNotification& proto) { | 304 const sync_pb::AppNotification& proto) { |
293 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 305 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
294 SET_STR(guid); | 306 SET_STR(guid); |
295 SET_STR(app_id); | 307 SET_STR(app_id); |
296 SET_INT64(creation_timestamp_ms); | 308 SET_INT64(creation_timestamp_ms); |
297 SET_STR(title); | 309 SET_STR(title); |
298 SET_STR(body_text); | 310 SET_STR(body_text); |
299 SET_STR(link_url); | 311 SET_STR(link_url); |
300 SET_STR(link_text); | 312 SET_STR(link_text); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 } | 631 } |
620 | 632 |
621 std::unique_ptr<base::DictionaryValue> PreferenceSpecificsToValue( | 633 std::unique_ptr<base::DictionaryValue> PreferenceSpecificsToValue( |
622 const sync_pb::PreferenceSpecifics& proto) { | 634 const sync_pb::PreferenceSpecifics& proto) { |
623 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 635 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
624 SET_STR(name); | 636 SET_STR(name); |
625 SET_STR(value); | 637 SET_STR(value); |
626 return value; | 638 return value; |
627 } | 639 } |
628 | 640 |
| 641 std::unique_ptr<base::DictionaryValue> PrinterSpecificsToValue( |
| 642 const sync_pb::PrinterSpecifics& proto) { |
| 643 std::unique_ptr<base::DictionaryValue> value = |
| 644 base::MakeUnique<base::DictionaryValue>(); |
| 645 SET_STR(id); |
| 646 SET_STR(display_name); |
| 647 SET_STR(description); |
| 648 SET_STR(manufacturer); |
| 649 SET_STR(model); |
| 650 SET_STR(uri); |
| 651 SET_STR(uuid); |
| 652 SET(ppd, PrinterPPDDataToValue); |
| 653 return value; |
| 654 } |
| 655 |
629 std::unique_ptr<base::DictionaryValue> PriorityPreferenceSpecificsToValue( | 656 std::unique_ptr<base::DictionaryValue> PriorityPreferenceSpecificsToValue( |
630 const sync_pb::PriorityPreferenceSpecifics& specifics) { | 657 const sync_pb::PriorityPreferenceSpecifics& specifics) { |
631 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 658 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
632 SET_FIELD(preference, PreferenceSpecificsToValue); | 659 SET_FIELD(preference, PreferenceSpecificsToValue); |
633 return value; | 660 return value; |
634 } | 661 } |
635 | 662 |
636 std::unique_ptr<base::DictionaryValue> | 663 std::unique_ptr<base::DictionaryValue> |
637 SyncedNotificationAppInfoSpecificsToValue( | 664 SyncedNotificationAppInfoSpecificsToValue( |
638 const sync_pb::SyncedNotificationAppInfoSpecifics& proto) { | 665 const sync_pb::SyncedNotificationAppInfoSpecifics& proto) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 SET_FIELD(favicon_tracking, FaviconTrackingSpecificsToValue); | 797 SET_FIELD(favicon_tracking, FaviconTrackingSpecificsToValue); |
771 SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue); | 798 SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue); |
772 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue); | 799 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue); |
773 SET_FIELD(managed_user_shared_setting, | 800 SET_FIELD(managed_user_shared_setting, |
774 ManagedUserSharedSettingSpecificsToValue); | 801 ManagedUserSharedSettingSpecificsToValue); |
775 SET_FIELD(managed_user, ManagedUserSpecificsToValue); | 802 SET_FIELD(managed_user, ManagedUserSpecificsToValue); |
776 SET_FIELD(managed_user_whitelist, ManagedUserWhitelistSpecificsToValue); | 803 SET_FIELD(managed_user_whitelist, ManagedUserWhitelistSpecificsToValue); |
777 SET_FIELD(nigori, NigoriSpecificsToValue); | 804 SET_FIELD(nigori, NigoriSpecificsToValue); |
778 SET_FIELD(password, PasswordSpecificsToValue); | 805 SET_FIELD(password, PasswordSpecificsToValue); |
779 SET_FIELD(preference, PreferenceSpecificsToValue); | 806 SET_FIELD(preference, PreferenceSpecificsToValue); |
| 807 SET_FIELD(printer, PrinterSpecificsToValue); |
780 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); | 808 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); |
781 SET_FIELD(search_engine, SearchEngineSpecificsToValue); | 809 SET_FIELD(search_engine, SearchEngineSpecificsToValue); |
782 SET_FIELD(session, SessionSpecificsToValue); | 810 SET_FIELD(session, SessionSpecificsToValue); |
783 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue); | 811 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue); |
784 SET_FIELD(synced_notification_app_info, | 812 SET_FIELD(synced_notification_app_info, |
785 SyncedNotificationAppInfoSpecificsToValue); | 813 SyncedNotificationAppInfoSpecificsToValue); |
786 SET_FIELD(theme, ThemeSpecificsToValue); | 814 SET_FIELD(theme, ThemeSpecificsToValue); |
787 SET_FIELD(typed_url, TypedUrlSpecificsToValue); | 815 SET_FIELD(typed_url, TypedUrlSpecificsToValue); |
788 SET_FIELD(wifi_credential, WifiCredentialSpecificsToValue); | 816 SET_FIELD(wifi_credential, WifiCredentialSpecificsToValue); |
789 return value; | 817 return value; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 #undef SET_BYTES | 1126 #undef SET_BYTES |
1099 #undef SET_INT32 | 1127 #undef SET_INT32 |
1100 #undef SET_INT64 | 1128 #undef SET_INT64 |
1101 #undef SET_INT64_REP | 1129 #undef SET_INT64_REP |
1102 #undef SET_STR | 1130 #undef SET_STR |
1103 #undef SET_STR_REP | 1131 #undef SET_STR_REP |
1104 | 1132 |
1105 #undef SET_FIELD | 1133 #undef SET_FIELD |
1106 | 1134 |
1107 } // namespace syncer | 1135 } // namespace syncer |
OLD | NEW |