| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 SET_STR(username_value); | 184 SET_STR(username_value); |
| 185 SET_STR(password_element); | 185 SET_STR(password_element); |
| 186 value->SetString("password_value", "<redacted>"); | 186 value->SetString("password_value", "<redacted>"); |
| 187 SET_BOOL(ssl_valid); | 187 SET_BOOL(ssl_valid); |
| 188 SET_BOOL(preferred); | 188 SET_BOOL(preferred); |
| 189 SET_INT64(date_created); | 189 SET_INT64(date_created); |
| 190 SET_BOOL(blacklisted); | 190 SET_BOOL(blacklisted); |
| 191 return value; | 191 return value; |
| 192 } | 192 } |
| 193 | 193 |
| 194 DictionaryValue* DeviceInformationToValue( | 194 DictionaryValue* DeviceInfoSpecificsToValue( |
| 195 const sync_pb::DeviceInformation& proto) { | 195 const sync_pb::DeviceInfoSpecifics& proto) { |
| 196 DictionaryValue* value = new DictionaryValue(); | 196 DictionaryValue* value = new DictionaryValue(); |
| 197 SET_STR(cache_guid); | 197 SET_STR(cache_guid); |
| 198 SET_STR(name); | 198 SET_STR(client_name); |
| 199 SET_STR(platform); | 199 SET_ENUM(device_type, GetDeviceTypeString); |
| 200 SET_STR(chrome_version); | 200 SET_STR(sync_user_agent); |
| 201 return value; | 201 return value; |
| 202 } | 202 } |
| 203 | 203 |
| 204 DictionaryValue* AppNotificationToValue( | 204 DictionaryValue* AppNotificationToValue( |
| 205 const sync_pb::AppNotification& proto) { | 205 const sync_pb::AppNotification& proto) { |
| 206 DictionaryValue* value = new DictionaryValue(); | 206 DictionaryValue* value = new DictionaryValue(); |
| 207 SET_STR(guid); | 207 SET_STR(guid); |
| 208 SET_STR(app_id); | 208 SET_STR(app_id); |
| 209 SET_INT64(creation_timestamp_ms); | 209 SET_INT64(creation_timestamp_ms); |
| 210 SET_STR(title); | 210 SET_STR(title); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 SET_BOOL(encrypt_autofill); | 306 SET_BOOL(encrypt_autofill); |
| 307 SET_BOOL(encrypt_themes); | 307 SET_BOOL(encrypt_themes); |
| 308 SET_BOOL(encrypt_typed_urls); | 308 SET_BOOL(encrypt_typed_urls); |
| 309 SET_BOOL(encrypt_extension_settings); | 309 SET_BOOL(encrypt_extension_settings); |
| 310 SET_BOOL(encrypt_extensions); | 310 SET_BOOL(encrypt_extensions); |
| 311 SET_BOOL(encrypt_sessions); | 311 SET_BOOL(encrypt_sessions); |
| 312 SET_BOOL(encrypt_app_settings); | 312 SET_BOOL(encrypt_app_settings); |
| 313 SET_BOOL(encrypt_apps); | 313 SET_BOOL(encrypt_apps); |
| 314 SET_BOOL(encrypt_search_engines); | 314 SET_BOOL(encrypt_search_engines); |
| 315 SET_BOOL(encrypt_everything); | 315 SET_BOOL(encrypt_everything); |
| 316 SET_REP(device_information, DeviceInformationToValue); | |
| 317 SET_BOOL(sync_tab_favicons); | 316 SET_BOOL(sync_tab_favicons); |
| 318 SET_ENUM(passphrase_type, PassphraseTypeString); | 317 SET_ENUM(passphrase_type, PassphraseTypeString); |
| 319 SET(keystore_decryptor_token, EncryptedDataToValue); | 318 SET(keystore_decryptor_token, EncryptedDataToValue); |
| 320 SET_INT64(keystore_migration_time); | 319 SET_INT64(keystore_migration_time); |
| 321 return value; | 320 return value; |
| 322 } | 321 } |
| 323 | 322 |
| 324 DictionaryValue* PasswordSpecificsToValue( | 323 DictionaryValue* PasswordSpecificsToValue( |
| 325 const sync_pb::PasswordSpecifics& proto) { | 324 const sync_pb::PasswordSpecifics& proto) { |
| 326 DictionaryValue* value = new DictionaryValue(); | 325 DictionaryValue* value = new DictionaryValue(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 390 |
| 392 DictionaryValue* EntitySpecificsToValue( | 391 DictionaryValue* EntitySpecificsToValue( |
| 393 const sync_pb::EntitySpecifics& specifics) { | 392 const sync_pb::EntitySpecifics& specifics) { |
| 394 DictionaryValue* value = new DictionaryValue(); | 393 DictionaryValue* value = new DictionaryValue(); |
| 395 SET_FIELD(app, AppSpecificsToValue); | 394 SET_FIELD(app, AppSpecificsToValue); |
| 396 SET_FIELD(app_notification, AppNotificationToValue); | 395 SET_FIELD(app_notification, AppNotificationToValue); |
| 397 SET_FIELD(app_setting, AppSettingSpecificsToValue); | 396 SET_FIELD(app_setting, AppSettingSpecificsToValue); |
| 398 SET_FIELD(autofill, AutofillSpecificsToValue); | 397 SET_FIELD(autofill, AutofillSpecificsToValue); |
| 399 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); | 398 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); |
| 400 SET_FIELD(bookmark, BookmarkSpecificsToValue); | 399 SET_FIELD(bookmark, BookmarkSpecificsToValue); |
| 400 SET_FIELD(device_info, DeviceInfoSpecificsToValue); |
| 401 SET_FIELD(extension, ExtensionSpecificsToValue); | 401 SET_FIELD(extension, ExtensionSpecificsToValue); |
| 402 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); | 402 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); |
| 403 SET_FIELD(nigori, NigoriSpecificsToValue); | 403 SET_FIELD(nigori, NigoriSpecificsToValue); |
| 404 SET_FIELD(password, PasswordSpecificsToValue); | 404 SET_FIELD(password, PasswordSpecificsToValue); |
| 405 SET_FIELD(preference, PreferenceSpecificsToValue); | 405 SET_FIELD(preference, PreferenceSpecificsToValue); |
| 406 SET_FIELD(search_engine, SearchEngineSpecificsToValue); | 406 SET_FIELD(search_engine, SearchEngineSpecificsToValue); |
| 407 SET_FIELD(session, SessionSpecificsToValue); | 407 SET_FIELD(session, SessionSpecificsToValue); |
| 408 SET_FIELD(theme, ThemeSpecificsToValue); | 408 SET_FIELD(theme, ThemeSpecificsToValue); |
| 409 SET_FIELD(typed_url, TypedUrlSpecificsToValue); | 409 SET_FIELD(typed_url, TypedUrlSpecificsToValue); |
| 410 return value; | 410 return value; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 #undef SET_BYTES | 594 #undef SET_BYTES |
| 595 #undef SET_INT32 | 595 #undef SET_INT32 |
| 596 #undef SET_INT64 | 596 #undef SET_INT64 |
| 597 #undef SET_INT64_REP | 597 #undef SET_INT64_REP |
| 598 #undef SET_STR | 598 #undef SET_STR |
| 599 #undef SET_STR_REP | 599 #undef SET_STR_REP |
| 600 | 600 |
| 601 #undef SET_FIELD | 601 #undef SET_FIELD |
| 602 | 602 |
| 603 } // namespace syncer | 603 } // namespace syncer |
| OLD | NEW |