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

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: Work 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 const sync_pb::EntitySpecifics& specifics) { 733 const sync_pb::EntitySpecifics& specifics) {
724 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 734 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
725 SET_FIELD(app, AppSpecificsToValue); 735 SET_FIELD(app, AppSpecificsToValue);
726 SET_FIELD(app_list, AppListSpecificsToValue); 736 SET_FIELD(app_list, AppListSpecificsToValue);
727 SET_FIELD(app_notification, AppNotificationToValue); 737 SET_FIELD(app_notification, AppNotificationToValue);
728 SET_FIELD(app_setting, AppSettingSpecificsToValue); 738 SET_FIELD(app_setting, AppSettingSpecificsToValue);
729 SET_FIELD(article, ArticleSpecificsToValue); 739 SET_FIELD(article, ArticleSpecificsToValue);
730 SET_FIELD(autofill, AutofillSpecificsToValue); 740 SET_FIELD(autofill, AutofillSpecificsToValue);
731 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); 741 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue);
732 SET_FIELD(autofill_wallet, AutofillWalletSpecificsToValue); 742 SET_FIELD(autofill_wallet, AutofillWalletSpecificsToValue);
743 SET_FIELD(wallet_metadata, WalletMetadataSpecificsToValue);
733 SET_FIELD(bookmark, BookmarkSpecificsToValue); 744 SET_FIELD(bookmark, BookmarkSpecificsToValue);
734 SET_FIELD(device_info, DeviceInfoSpecificsToValue); 745 SET_FIELD(device_info, DeviceInfoSpecificsToValue);
735 SET_FIELD(dictionary, DictionarySpecificsToValue); 746 SET_FIELD(dictionary, DictionarySpecificsToValue);
736 SET_FIELD(experiments, ExperimentsSpecificsToValue); 747 SET_FIELD(experiments, ExperimentsSpecificsToValue);
737 SET_FIELD(extension, ExtensionSpecificsToValue); 748 SET_FIELD(extension, ExtensionSpecificsToValue);
738 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); 749 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue);
739 SET_FIELD(favicon_image, FaviconImageSpecificsToValue); 750 SET_FIELD(favicon_image, FaviconImageSpecificsToValue);
740 SET_FIELD(favicon_tracking, FaviconTrackingSpecificsToValue); 751 SET_FIELD(favicon_tracking, FaviconTrackingSpecificsToValue);
741 SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue); 752 SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue);
742 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue); 753 SET_FIELD(managed_user_setting, ManagedUserSettingSpecificsToValue);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 #undef SET_BYTES 1078 #undef SET_BYTES
1068 #undef SET_INT32 1079 #undef SET_INT32
1069 #undef SET_INT64 1080 #undef SET_INT64
1070 #undef SET_INT64_REP 1081 #undef SET_INT64_REP
1071 #undef SET_STR 1082 #undef SET_STR
1072 #undef SET_STR_REP 1083 #undef SET_STR_REP
1073 1084
1074 #undef SET_FIELD 1085 #undef SET_FIELD
1075 1086
1076 } // namespace syncer 1087 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/protocol/proto_value_conversions.h ('k') | sync/protocol/proto_value_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698