| 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 if (card.has_bank_name()) { |
| 86 result.SetBankName(card.bank_name()); |
| 87 } |
| 85 return result; | 88 return result; |
| 86 } | 89 } |
| 87 | 90 |
| 88 AutofillProfile ProfileFromSpecifics( | 91 AutofillProfile ProfileFromSpecifics( |
| 89 const sync_pb::WalletPostalAddress& address) { | 92 const sync_pb::WalletPostalAddress& address) { |
| 90 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); | 93 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); |
| 91 | 94 |
| 92 // AutofillProfile stores multi-line addresses with newline separators. | 95 // AutofillProfile stores multi-line addresses with newline separators. |
| 93 std::vector<base::StringPiece> street_address( | 96 std::vector<base::StringPiece> street_address( |
| 94 address.street_address().begin(), address.street_address().end()); | 97 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( | 359 merge_result.set_num_items_after_association( |
| 357 static_cast<int>(wallet_cards.size() + wallet_addresses.size())); | 360 static_cast<int>(wallet_cards.size() + wallet_addresses.size())); |
| 358 | 361 |
| 359 if (webdata_backend_ && (changed_cards || changed_addresses)) | 362 if (webdata_backend_ && (changed_cards || changed_addresses)) |
| 360 webdata_backend_->NotifyOfMultipleAutofillChanges(); | 363 webdata_backend_->NotifyOfMultipleAutofillChanges(); |
| 361 | 364 |
| 362 return merge_result; | 365 return merge_result; |
| 363 } | 366 } |
| 364 | 367 |
| 365 } // namespace autofill | 368 } // namespace autofill |
| OLD | NEW |