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