| 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" | 
| 11 #include "base/logging.h" | 11 #include "base/logging.h" | 
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" | 
| 13 #include "base/values.h" | 13 #include "base/values.h" | 
| 14 #include "sync/protocol/app_notification_specifics.pb.h" | 14 #include "sync/protocol/app_notification_specifics.pb.h" | 
| 15 #include "sync/protocol/app_setting_specifics.pb.h" | 15 #include "sync/protocol/app_setting_specifics.pb.h" | 
| 16 #include "sync/protocol/app_specifics.pb.h" | 16 #include "sync/protocol/app_specifics.pb.h" | 
| 17 #include "sync/protocol/autofill_specifics.pb.h" | 17 #include "sync/protocol/autofill_specifics.pb.h" | 
| 18 #include "sync/protocol/bookmark_specifics.pb.h" | 18 #include "sync/protocol/bookmark_specifics.pb.h" | 
|  | 19 #include "sync/protocol/dictionary_specifics.pb.h" | 
| 19 #include "sync/protocol/encryption.pb.h" | 20 #include "sync/protocol/encryption.pb.h" | 
| 20 #include "sync/protocol/experiments_specifics.pb.h" | 21 #include "sync/protocol/experiments_specifics.pb.h" | 
| 21 #include "sync/protocol/extension_setting_specifics.pb.h" | 22 #include "sync/protocol/extension_setting_specifics.pb.h" | 
| 22 #include "sync/protocol/extension_specifics.pb.h" | 23 #include "sync/protocol/extension_specifics.pb.h" | 
| 23 #include "sync/protocol/history_delete_directive_specifics.pb.h" | 24 #include "sync/protocol/history_delete_directive_specifics.pb.h" | 
| 24 #include "sync/protocol/nigori_specifics.pb.h" | 25 #include "sync/protocol/nigori_specifics.pb.h" | 
| 25 #include "sync/protocol/password_specifics.pb.h" | 26 #include "sync/protocol/password_specifics.pb.h" | 
| 26 #include "sync/protocol/preference_specifics.pb.h" | 27 #include "sync/protocol/preference_specifics.pb.h" | 
| 27 #include "sync/protocol/priority_preference_specifics.pb.h" | 28 #include "sync/protocol/priority_preference_specifics.pb.h" | 
| 28 #include "sync/protocol/proto_enum_conversions.h" | 29 #include "sync/protocol/proto_enum_conversions.h" | 
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 312     const sync_pb::DeviceInfoSpecifics& proto) { | 313     const sync_pb::DeviceInfoSpecifics& proto) { | 
| 313   DictionaryValue* value = new DictionaryValue(); | 314   DictionaryValue* value = new DictionaryValue(); | 
| 314   SET_STR(cache_guid); | 315   SET_STR(cache_guid); | 
| 315   SET_STR(client_name); | 316   SET_STR(client_name); | 
| 316   SET_ENUM(device_type, GetDeviceTypeString); | 317   SET_ENUM(device_type, GetDeviceTypeString); | 
| 317   SET_STR(sync_user_agent); | 318   SET_STR(sync_user_agent); | 
| 318   SET_STR(chrome_version); | 319   SET_STR(chrome_version); | 
| 319   return value; | 320   return value; | 
| 320 } | 321 } | 
| 321 | 322 | 
|  | 323 base::DictionaryValue* DictionarySpecificsToValue( | 
|  | 324     const sync_pb::DictionarySpecifics& proto) { | 
|  | 325   DictionaryValue* value = new DictionaryValue(); | 
|  | 326   SET_STR(word); | 
|  | 327   return value; | 
|  | 328 } | 
|  | 329 | 
| 322 DictionaryValue* ExperimentsSpecificsToValue( | 330 DictionaryValue* ExperimentsSpecificsToValue( | 
| 323     const sync_pb::ExperimentsSpecifics& proto) { | 331     const sync_pb::ExperimentsSpecifics& proto) { | 
| 324   DictionaryValue* value = new DictionaryValue(); | 332   DictionaryValue* value = new DictionaryValue(); | 
| 325   SET(keystore_encryption, KeystoreEncryptionFlagsToValue); | 333   SET(keystore_encryption, KeystoreEncryptionFlagsToValue); | 
| 326   return value; | 334   return value; | 
| 327 } | 335 } | 
| 328 | 336 | 
| 329 DictionaryValue* ExtensionSettingSpecificsToValue( | 337 DictionaryValue* ExtensionSettingSpecificsToValue( | 
| 330     const sync_pb::ExtensionSettingSpecifics& proto) { | 338     const sync_pb::ExtensionSettingSpecifics& proto) { | 
| 331   DictionaryValue* value = new DictionaryValue(); | 339   DictionaryValue* value = new DictionaryValue(); | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 365   SET_BOOL(encrypt_autofill_profile); | 373   SET_BOOL(encrypt_autofill_profile); | 
| 366   SET_BOOL(encrypt_autofill); | 374   SET_BOOL(encrypt_autofill); | 
| 367   SET_BOOL(encrypt_themes); | 375   SET_BOOL(encrypt_themes); | 
| 368   SET_BOOL(encrypt_typed_urls); | 376   SET_BOOL(encrypt_typed_urls); | 
| 369   SET_BOOL(encrypt_extension_settings); | 377   SET_BOOL(encrypt_extension_settings); | 
| 370   SET_BOOL(encrypt_extensions); | 378   SET_BOOL(encrypt_extensions); | 
| 371   SET_BOOL(encrypt_sessions); | 379   SET_BOOL(encrypt_sessions); | 
| 372   SET_BOOL(encrypt_app_settings); | 380   SET_BOOL(encrypt_app_settings); | 
| 373   SET_BOOL(encrypt_apps); | 381   SET_BOOL(encrypt_apps); | 
| 374   SET_BOOL(encrypt_search_engines); | 382   SET_BOOL(encrypt_search_engines); | 
|  | 383   SET_BOOL(encrypt_dictionary); | 
| 375   SET_BOOL(encrypt_everything); | 384   SET_BOOL(encrypt_everything); | 
| 376   SET_BOOL(sync_tab_favicons); | 385   SET_BOOL(sync_tab_favicons); | 
| 377   SET_ENUM(passphrase_type, PassphraseTypeString); | 386   SET_ENUM(passphrase_type, PassphraseTypeString); | 
| 378   SET(keystore_decryptor_token, EncryptedDataToValue); | 387   SET(keystore_decryptor_token, EncryptedDataToValue); | 
| 379   SET_INT64(keystore_migration_time); | 388   SET_INT64(keystore_migration_time); | 
| 380   SET_INT64(custom_passphrase_time); | 389   SET_INT64(custom_passphrase_time); | 
| 381   return value; | 390   return value; | 
| 382 } | 391 } | 
| 383 | 392 | 
| 384 DictionaryValue* PasswordSpecificsToValue( | 393 DictionaryValue* PasswordSpecificsToValue( | 
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 461 DictionaryValue* EntitySpecificsToValue( | 470 DictionaryValue* EntitySpecificsToValue( | 
| 462     const sync_pb::EntitySpecifics& specifics) { | 471     const sync_pb::EntitySpecifics& specifics) { | 
| 463   DictionaryValue* value = new DictionaryValue(); | 472   DictionaryValue* value = new DictionaryValue(); | 
| 464   SET_FIELD(app, AppSpecificsToValue); | 473   SET_FIELD(app, AppSpecificsToValue); | 
| 465   SET_FIELD(app_notification, AppNotificationToValue); | 474   SET_FIELD(app_notification, AppNotificationToValue); | 
| 466   SET_FIELD(app_setting, AppSettingSpecificsToValue); | 475   SET_FIELD(app_setting, AppSettingSpecificsToValue); | 
| 467   SET_FIELD(autofill, AutofillSpecificsToValue); | 476   SET_FIELD(autofill, AutofillSpecificsToValue); | 
| 468   SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); | 477   SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); | 
| 469   SET_FIELD(bookmark, BookmarkSpecificsToValue); | 478   SET_FIELD(bookmark, BookmarkSpecificsToValue); | 
| 470   SET_FIELD(device_info, DeviceInfoSpecificsToValue); | 479   SET_FIELD(device_info, DeviceInfoSpecificsToValue); | 
|  | 480   SET_FIELD(dictionary, DictionarySpecificsToValue); | 
| 471   SET_FIELD(experiments, ExperimentsSpecificsToValue); | 481   SET_FIELD(experiments, ExperimentsSpecificsToValue); | 
| 472   SET_FIELD(extension, ExtensionSpecificsToValue); | 482   SET_FIELD(extension, ExtensionSpecificsToValue); | 
| 473   SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); | 483   SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); | 
| 474   SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue); | 484   SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue); | 
| 475   SET_FIELD(nigori, NigoriSpecificsToValue); | 485   SET_FIELD(nigori, NigoriSpecificsToValue); | 
| 476   SET_FIELD(password, PasswordSpecificsToValue); | 486   SET_FIELD(password, PasswordSpecificsToValue); | 
| 477   SET_FIELD(preference, PreferenceSpecificsToValue); | 487   SET_FIELD(preference, PreferenceSpecificsToValue); | 
| 478   SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); | 488   SET_FIELD(priority_preference, PriorityPreferenceSpecificsToValue); | 
| 479   SET_FIELD(search_engine, SearchEngineSpecificsToValue); | 489   SET_FIELD(search_engine, SearchEngineSpecificsToValue); | 
| 480   SET_FIELD(session, SessionSpecificsToValue); | 490   SET_FIELD(session, SessionSpecificsToValue); | 
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 736 #undef SET_BYTES | 746 #undef SET_BYTES | 
| 737 #undef SET_INT32 | 747 #undef SET_INT32 | 
| 738 #undef SET_INT64 | 748 #undef SET_INT64 | 
| 739 #undef SET_INT64_REP | 749 #undef SET_INT64_REP | 
| 740 #undef SET_STR | 750 #undef SET_STR | 
| 741 #undef SET_STR_REP | 751 #undef SET_STR_REP | 
| 742 | 752 | 
| 743 #undef SET_FIELD | 753 #undef SET_FIELD | 
| 744 | 754 | 
| 745 }  // namespace syncer | 755 }  // namespace syncer | 
| OLD | NEW | 
|---|