Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: sync/protocol/proto_value_conversions.cc

Issue 1140653006: [sync] Add WalletMetadataSpecifics protobuf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 351
352 SET_STR(address_home_street_address); 352 SET_STR(address_home_street_address);
353 SET_STR(address_home_sorting_code); 353 SET_STR(address_home_sorting_code);
354 SET_STR(address_home_dependent_locality); 354 SET_STR(address_home_dependent_locality);
355 SET_STR(address_home_language_code); 355 SET_STR(address_home_language_code);
356 356
357 SET_STR_REP(phone_home_whole_number); 357 SET_STR_REP(phone_home_whole_number);
358 return value; 358 return value;
359 } 359 }
360 360
361 scoped_ptr<base::DictionaryValue> WalletMetadataSpecificsToValue(
362 const sync_pb::WalletMetadataSpecifics& proto) {
363 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
364 SET_ENUM(type, GetWalletMetadataTypeString);
365 SET_STR(id);
366 SET_INT64(use_count);
367 SET_INT64(use_date);
368 return value;
369 }
370
361 scoped_ptr<base::DictionaryValue> AutofillWalletSpecificsToValue( 371 scoped_ptr<base::DictionaryValue> AutofillWalletSpecificsToValue(
362 const sync_pb::AutofillWalletSpecifics& proto) { 372 const sync_pb::AutofillWalletSpecifics& proto) {
363 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 373 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
364 374
365 SET_ENUM(type, GetWalletInfoTypeString); 375 SET_ENUM(type, GetWalletInfoTypeString);
366 if (proto.type() == sync_pb::AutofillWalletSpecifics::MASKED_CREDIT_CARD) { 376 if (proto.type() == sync_pb::AutofillWalletSpecifics::MASKED_CREDIT_CARD) {
367 value->Set("masked_card", 377 value->Set("masked_card",
368 WalletMaskedCreditCardToValue(proto.masked_card())); 378 WalletMaskedCreditCardToValue(proto.masked_card()));
369 } else if (proto.type() == sync_pb::AutofillWalletSpecifics::POSTAL_ADDRESS) { 379 } else if (proto.type() == sync_pb::AutofillWalletSpecifics::POSTAL_ADDRESS) {
370 value->Set("address", 380 value->Set("address",
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 const sync_pb::EntitySpecifics& specifics) { 732 const sync_pb::EntitySpecifics& specifics) {
723 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 733 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
724 SET_FIELD(app, AppSpecificsToValue); 734 SET_FIELD(app, AppSpecificsToValue);
725 SET_FIELD(app_list, AppListSpecificsToValue); 735 SET_FIELD(app_list, AppListSpecificsToValue);
726 SET_FIELD(app_notification, AppNotificationToValue); 736 SET_FIELD(app_notification, AppNotificationToValue);
727 SET_FIELD(app_setting, AppSettingSpecificsToValue); 737 SET_FIELD(app_setting, AppSettingSpecificsToValue);
728 SET_FIELD(article, ArticleSpecificsToValue); 738 SET_FIELD(article, ArticleSpecificsToValue);
729 SET_FIELD(autofill, AutofillSpecificsToValue); 739 SET_FIELD(autofill, AutofillSpecificsToValue);
730 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); 740 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue);
731 SET_FIELD(autofill_wallet, AutofillWalletSpecificsToValue); 741 SET_FIELD(autofill_wallet, AutofillWalletSpecificsToValue);
742 SET_FIELD(wallet_metadata, WalletMetadataSpecificsToValue);
732 SET_FIELD(bookmark, BookmarkSpecificsToValue); 743 SET_FIELD(bookmark, BookmarkSpecificsToValue);
733 SET_FIELD(device_info, DeviceInfoSpecificsToValue); 744 SET_FIELD(device_info, DeviceInfoSpecificsToValue);
734 SET_FIELD(dictionary, DictionarySpecificsToValue); 745 SET_FIELD(dictionary, DictionarySpecificsToValue);
735 SET_FIELD(experiments, ExperimentsSpecificsToValue); 746 SET_FIELD(experiments, ExperimentsSpecificsToValue);
736 SET_FIELD(extension, ExtensionSpecificsToValue); 747 SET_FIELD(extension, ExtensionSpecificsToValue);
737 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); 748 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue);
738 SET_FIELD(favicon_image, FaviconImageSpecificsToValue); 749 SET_FIELD(favicon_image, FaviconImageSpecificsToValue);
739 SET_FIELD(favicon_tracking, FaviconTrackingSpecificsToValue); 750 SET_FIELD(favicon_tracking, FaviconTrackingSpecificsToValue);
740 SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue); 751 SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue);
741 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue); 752 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 #undef SET_BYTES 1077 #undef SET_BYTES
1067 #undef SET_INT32 1078 #undef SET_INT32
1068 #undef SET_INT64 1079 #undef SET_INT64
1069 #undef SET_INT64_REP 1080 #undef SET_INT64_REP
1070 #undef SET_STR 1081 #undef SET_STR
1071 #undef SET_STR_REP 1082 #undef SET_STR_REP
1072 1083
1073 #undef SET_FIELD 1084 #undef SET_FIELD
1074 1085
1075 } // namespace syncer 1086 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698