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 <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) { | 71 CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) { |
72 CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id()); | 72 CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id()); |
73 result.SetNumber(base::UTF8ToUTF16(card.last_four())); | 73 result.SetNumber(base::UTF8ToUTF16(card.last_four())); |
74 result.SetServerStatus(ServerToLocalStatus(card.status())); | 74 result.SetServerStatus(ServerToLocalStatus(card.status())); |
75 result.SetTypeForMaskedCard(CardTypeFromWalletCardType(card.type())); | 75 result.SetTypeForMaskedCard(CardTypeFromWalletCardType(card.type())); |
76 result.SetRawInfo(CREDIT_CARD_NAME_FULL, | 76 result.SetRawInfo(CREDIT_CARD_NAME_FULL, |
77 base::UTF8ToUTF16(card.name_on_card())); | 77 base::UTF8ToUTF16(card.name_on_card())); |
78 result.SetExpirationMonth(card.exp_month()); | 78 result.SetExpirationMonth(card.exp_month()); |
79 result.SetExpirationYear(card.exp_year()); | 79 result.SetExpirationYear(card.exp_year()); |
| 80 if (card.has_bank_name()) { |
| 81 result.SetBankName(base::UTF8ToUTF16(card.bank_name())); |
| 82 } |
80 result.set_billing_address_id(card.billing_address_id()); | 83 result.set_billing_address_id(card.billing_address_id()); |
81 return result; | 84 return result; |
82 } | 85 } |
83 | 86 |
84 AutofillProfile ProfileFromSpecifics( | 87 AutofillProfile ProfileFromSpecifics( |
85 const sync_pb::WalletPostalAddress& address) { | 88 const sync_pb::WalletPostalAddress& address) { |
86 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); | 89 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); |
87 | 90 |
88 // AutofillProfile stores multi-line addresses with newline separators. | 91 // AutofillProfile stores multi-line addresses with newline separators. |
89 std::vector<std::string> street_address(address.street_address().begin(), | 92 std::vector<std::string> street_address(address.street_address().begin(), |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 merge_result.set_num_items_after_association( | 350 merge_result.set_num_items_after_association( |
348 static_cast<int>(wallet_cards.size() + wallet_addresses.size())); | 351 static_cast<int>(wallet_cards.size() + wallet_addresses.size())); |
349 | 352 |
350 if (webdata_backend_ && (changed_cards || changed_addresses)) | 353 if (webdata_backend_ && (changed_cards || changed_addresses)) |
351 webdata_backend_->NotifyOfMultipleAutofillChanges(); | 354 webdata_backend_->NotifyOfMultipleAutofillChanges(); |
352 | 355 |
353 return merge_result; | 356 return merge_result; |
354 } | 357 } |
355 | 358 |
356 } // namespace autofil | 359 } // namespace autofil |
OLD | NEW |