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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 const sync_pb::TypedUrlSpecifics& proto) { | 776 const sync_pb::TypedUrlSpecifics& proto) { |
777 base::DictionaryValue* value = new base::DictionaryValue(); | 777 base::DictionaryValue* value = new base::DictionaryValue(); |
778 SET_STR(url); | 778 SET_STR(url); |
779 SET_STR(title); | 779 SET_STR(title); |
780 SET_BOOL(hidden); | 780 SET_BOOL(hidden); |
781 SET_INT64_REP(visits); | 781 SET_INT64_REP(visits); |
782 SET_INT32_REP(visit_transitions); | 782 SET_INT32_REP(visit_transitions); |
783 return value; | 783 return value; |
784 } | 784 } |
785 | 785 |
| 786 base::DictionaryValue* WifiCredentialSpecificsToValue( |
| 787 const sync_pb::WifiCredentialSpecifics& proto) { |
| 788 base::DictionaryValue* value = new base::DictionaryValue(); |
| 789 SET_BYTES(ssid); |
| 790 SET_ENUM(security_class, GetWifiCredentialSecurityClassString); |
| 791 SET_BYTES(passphrase); |
| 792 return value; |
| 793 } |
| 794 |
786 base::DictionaryValue* EntitySpecificsToValue( | 795 base::DictionaryValue* EntitySpecificsToValue( |
787 const sync_pb::EntitySpecifics& specifics) { | 796 const sync_pb::EntitySpecifics& specifics) { |
788 base::DictionaryValue* value = new base::DictionaryValue(); | 797 base::DictionaryValue* value = new base::DictionaryValue(); |
789 SET_FIELD(app, AppSpecificsToValue); | 798 SET_FIELD(app, AppSpecificsToValue); |
790 SET_FIELD(app_list, AppListSpecificsToValue); | 799 SET_FIELD(app_list, AppListSpecificsToValue); |
791 SET_FIELD(app_notification, AppNotificationToValue); | 800 SET_FIELD(app_notification, AppNotificationToValue); |
792 SET_FIELD(app_setting, AppSettingSpecificsToValue); | 801 SET_FIELD(app_setting, AppSettingSpecificsToValue); |
793 SET_FIELD(article, ArticleSpecificsToValue); | 802 SET_FIELD(article, ArticleSpecificsToValue); |
794 SET_FIELD(autofill, AutofillSpecificsToValue); | 803 SET_FIELD(autofill, AutofillSpecificsToValue); |
795 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); | 804 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); |
(...skipping 14 matching lines...) Expand all Loading... |
810 SET_FIELD(password, PasswordSpecificsToValue); | 819 SET_FIELD(password, PasswordSpecificsToValue); |
811 SET_FIELD(preference, PreferenceSpecificsToValue); | 820 SET_FIELD(preference, PreferenceSpecificsToValue); |
812 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); | 821 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); |
813 SET_FIELD(search_engine, SearchEngineSpecificsToValue); | 822 SET_FIELD(search_engine, SearchEngineSpecificsToValue); |
814 SET_FIELD(session, SessionSpecificsToValue); | 823 SET_FIELD(session, SessionSpecificsToValue); |
815 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue); | 824 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue); |
816 SET_FIELD(synced_notification_app_info, | 825 SET_FIELD(synced_notification_app_info, |
817 SyncedNotificationAppInfoSpecificsToValue); | 826 SyncedNotificationAppInfoSpecificsToValue); |
818 SET_FIELD(theme, ThemeSpecificsToValue); | 827 SET_FIELD(theme, ThemeSpecificsToValue); |
819 SET_FIELD(typed_url, TypedUrlSpecificsToValue); | 828 SET_FIELD(typed_url, TypedUrlSpecificsToValue); |
| 829 SET_FIELD(wifi_credential, WifiCredentialSpecificsToValue); |
820 return value; | 830 return value; |
821 } | 831 } |
822 | 832 |
823 namespace { | 833 namespace { |
824 | 834 |
825 base::StringValue* UniquePositionToStringValue( | 835 base::StringValue* UniquePositionToStringValue( |
826 const sync_pb::UniquePosition& proto) { | 836 const sync_pb::UniquePosition& proto) { |
827 UniquePosition pos = UniquePosition::FromProto(proto); | 837 UniquePosition pos = UniquePosition::FromProto(proto); |
828 return new base::StringValue(pos.ToDebugString()); | 838 return new base::StringValue(pos.ToDebugString()); |
829 } | 839 } |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 #undef SET_BYTES | 1134 #undef SET_BYTES |
1125 #undef SET_INT32 | 1135 #undef SET_INT32 |
1126 #undef SET_INT64 | 1136 #undef SET_INT64 |
1127 #undef SET_INT64_REP | 1137 #undef SET_INT64_REP |
1128 #undef SET_STR | 1138 #undef SET_STR |
1129 #undef SET_STR_REP | 1139 #undef SET_STR_REP |
1130 | 1140 |
1131 #undef SET_FIELD | 1141 #undef SET_FIELD |
1132 | 1142 |
1133 } // namespace syncer | 1143 } // namespace syncer |
OLD | NEW |