| Index: components/autofill/core/browser/personal_data_manager.cc
|
| diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
|
| index 781ddd080fb2b4c50257e84120e601ea2eadb5df..9dad674efa5a3b008259a179932581bce5d8963e 100644
|
| --- a/components/autofill/core/browser/personal_data_manager.cc
|
| +++ b/components/autofill/core/browser/personal_data_manager.cc
|
| @@ -584,6 +584,33 @@ void PersonalDataManager::UpdateServerCreditCard(
|
| Refresh();
|
| }
|
|
|
| +void PersonalDataManager::UpdateServerCardBillingAddress(
|
| + const CreditCard& credit_card) {
|
| + DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type());
|
| +
|
| + if (!database_.get())
|
| + return;
|
| +
|
| + CreditCard* existing_credit_card = nullptr;
|
| + for (auto it : server_credit_cards_) {
|
| + if (credit_card.guid() == it->guid()) {
|
| + existing_credit_card = it;
|
| + break;
|
| + }
|
| + }
|
| + if (!existing_credit_card
|
| + || existing_credit_card->billing_address_id() ==
|
| + credit_card.billing_address_id()) {
|
| + return;
|
| + }
|
| +
|
| + existing_credit_card->set_billing_address_id(
|
| + credit_card.billing_address_id());
|
| + database_->UpdateServerCardBillingAddress(*existing_credit_card);
|
| +
|
| + Refresh();
|
| +}
|
| +
|
| void PersonalDataManager::ResetFullServerCard(const std::string& guid) {
|
| for (const CreditCard* card : server_credit_cards_) {
|
| if (card->guid() == guid) {
|
|
|