| 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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 const sync_pb::TypedUrlSpecifics& proto) { | 851 const sync_pb::TypedUrlSpecifics& proto) { |
| 852 base::DictionaryValue* value = new base::DictionaryValue(); | 852 base::DictionaryValue* value = new base::DictionaryValue(); |
| 853 SET_STR(url); | 853 SET_STR(url); |
| 854 SET_STR(title); | 854 SET_STR(title); |
| 855 SET_BOOL(hidden); | 855 SET_BOOL(hidden); |
| 856 SET_INT64_REP(visits); | 856 SET_INT64_REP(visits); |
| 857 SET_INT32_REP(visit_transitions); | 857 SET_INT32_REP(visit_transitions); |
| 858 return value; | 858 return value; |
| 859 } | 859 } |
| 860 | 860 |
| 861 base::DictionaryValue* WifiCredentialSpecificsToValue( |
| 862 const sync_pb::WifiCredentialSpecifics& proto) { |
| 863 base::DictionaryValue* value = new base::DictionaryValue(); |
| 864 SET_BYTES(ssid); |
| 865 SET_ENUM(security_class, GetWifiCredentialSecurityClassString); |
| 866 SET_BYTES(passphrase); |
| 867 return value; |
| 868 } |
| 869 |
| 861 base::DictionaryValue* EntitySpecificsToValue( | 870 base::DictionaryValue* EntitySpecificsToValue( |
| 862 const sync_pb::EntitySpecifics& specifics) { | 871 const sync_pb::EntitySpecifics& specifics) { |
| 863 base::DictionaryValue* value = new base::DictionaryValue(); | 872 base::DictionaryValue* value = new base::DictionaryValue(); |
| 864 SET_FIELD(app, AppSpecificsToValue); | 873 SET_FIELD(app, AppSpecificsToValue); |
| 865 SET_FIELD(app_list, AppListSpecificsToValue); | 874 SET_FIELD(app_list, AppListSpecificsToValue); |
| 866 SET_FIELD(app_notification, AppNotificationToValue); | 875 SET_FIELD(app_notification, AppNotificationToValue); |
| 867 SET_FIELD(app_setting, AppSettingSpecificsToValue); | 876 SET_FIELD(app_setting, AppSettingSpecificsToValue); |
| 868 SET_FIELD(article, ArticleSpecificsToValue); | 877 SET_FIELD(article, ArticleSpecificsToValue); |
| 869 SET_FIELD(autofill, AutofillSpecificsToValue); | 878 SET_FIELD(autofill, AutofillSpecificsToValue); |
| 870 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); | 879 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 886 SET_FIELD(password, PasswordSpecificsToValue); | 895 SET_FIELD(password, PasswordSpecificsToValue); |
| 887 SET_FIELD(preference, PreferenceSpecificsToValue); | 896 SET_FIELD(preference, PreferenceSpecificsToValue); |
| 888 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); | 897 SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); |
| 889 SET_FIELD(search_engine, SearchEngineSpecificsToValue); | 898 SET_FIELD(search_engine, SearchEngineSpecificsToValue); |
| 890 SET_FIELD(session, SessionSpecificsToValue); | 899 SET_FIELD(session, SessionSpecificsToValue); |
| 891 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue); | 900 SET_FIELD(synced_notification, SyncedNotificationSpecificsToValue); |
| 892 SET_FIELD(synced_notification_app_info, | 901 SET_FIELD(synced_notification_app_info, |
| 893 SyncedNotificationAppInfoSpecificsToValue); | 902 SyncedNotificationAppInfoSpecificsToValue); |
| 894 SET_FIELD(theme, ThemeSpecificsToValue); | 903 SET_FIELD(theme, ThemeSpecificsToValue); |
| 895 SET_FIELD(typed_url, TypedUrlSpecificsToValue); | 904 SET_FIELD(typed_url, TypedUrlSpecificsToValue); |
| 905 SET_FIELD(wifi_credential, WifiCredentialSpecificsToValue); |
| 896 return value; | 906 return value; |
| 897 } | 907 } |
| 898 | 908 |
| 899 namespace { | 909 namespace { |
| 900 | 910 |
| 901 base::StringValue* UniquePositionToStringValue( | 911 base::StringValue* UniquePositionToStringValue( |
| 902 const sync_pb::UniquePosition& proto) { | 912 const sync_pb::UniquePosition& proto) { |
| 903 UniquePosition pos = UniquePosition::FromProto(proto); | 913 UniquePosition pos = UniquePosition::FromProto(proto); |
| 904 return new base::StringValue(pos.ToDebugString()); | 914 return new base::StringValue(pos.ToDebugString()); |
| 905 } | 915 } |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 #undef SET_BYTES | 1210 #undef SET_BYTES |
| 1201 #undef SET_INT32 | 1211 #undef SET_INT32 |
| 1202 #undef SET_INT64 | 1212 #undef SET_INT64 |
| 1203 #undef SET_INT64_REP | 1213 #undef SET_INT64_REP |
| 1204 #undef SET_STR | 1214 #undef SET_STR |
| 1205 #undef SET_STR_REP | 1215 #undef SET_STR_REP |
| 1206 | 1216 |
| 1207 #undef SET_FIELD | 1217 #undef SET_FIELD |
| 1208 | 1218 |
| 1209 } // namespace syncer | 1219 } // namespace syncer |
| OLD | NEW |