OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" | 5 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) { | 75 CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) { |
76 CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id()); | 76 CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id()); |
77 result.SetNumber(base::UTF8ToUTF16(card.last_four())); | 77 result.SetNumber(base::UTF8ToUTF16(card.last_four())); |
78 result.SetServerStatus(ServerToLocalStatus(card.status())); | 78 result.SetServerStatus(ServerToLocalStatus(card.status())); |
79 result.SetNetworkForMaskedCard(CardTypeFromWalletCardType(card.type())); | 79 result.SetNetworkForMaskedCard(CardTypeFromWalletCardType(card.type())); |
80 result.SetRawInfo(CREDIT_CARD_NAME_FULL, | 80 result.SetRawInfo(CREDIT_CARD_NAME_FULL, |
81 base::UTF8ToUTF16(card.name_on_card())); | 81 base::UTF8ToUTF16(card.name_on_card())); |
82 result.SetExpirationMonth(card.exp_month()); | 82 result.SetExpirationMonth(card.exp_month()); |
83 result.SetExpirationYear(card.exp_year()); | 83 result.SetExpirationYear(card.exp_year()); |
84 result.set_billing_address_id(card.billing_address_id()); | 84 result.set_billing_address_id(card.billing_address_id()); |
| 85 result.set_bank_name(card.bank_name()); |
85 return result; | 86 return result; |
86 } | 87 } |
87 | 88 |
88 AutofillProfile ProfileFromSpecifics( | 89 AutofillProfile ProfileFromSpecifics( |
89 const sync_pb::WalletPostalAddress& address) { | 90 const sync_pb::WalletPostalAddress& address) { |
90 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); | 91 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); |
91 | 92 |
92 // AutofillProfile stores multi-line addresses with newline separators. | 93 // AutofillProfile stores multi-line addresses with newline separators. |
93 std::vector<base::StringPiece> street_address( | 94 std::vector<base::StringPiece> street_address( |
94 address.street_address().begin(), address.street_address().end()); | 95 address.street_address().begin(), address.street_address().end()); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 merge_result.set_num_items_after_association( | 357 merge_result.set_num_items_after_association( |
357 static_cast<int>(wallet_cards.size() + wallet_addresses.size())); | 358 static_cast<int>(wallet_cards.size() + wallet_addresses.size())); |
358 | 359 |
359 if (webdata_backend_ && (changed_cards || changed_addresses)) | 360 if (webdata_backend_ && (changed_cards || changed_addresses)) |
360 webdata_backend_->NotifyOfMultipleAutofillChanges(); | 361 webdata_backend_->NotifyOfMultipleAutofillChanges(); |
361 | 362 |
362 return merge_result; | 363 return merge_result; |
363 } | 364 } |
364 | 365 |
365 } // namespace autofill | 366 } // namespace autofill |
OLD | NEW |