| 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 61182febbd91e7487a8f8e661b2a8ed953d80866..6191dea71f35048e3fbd1992a691c536c29d26fc 100644
|
| --- a/components/autofill/core/browser/personal_data_manager.cc
|
| +++ b/components/autofill/core/browser/personal_data_manager.cc
|
| @@ -481,7 +481,7 @@ void PersonalDataManager::RecordUseOf(const AutofillDataModel& data_model) {
|
| if (credit_card->record_type() == CreditCard::LOCAL_CARD)
|
| database_->UpdateCreditCard(*credit_card);
|
| else
|
| - database_->UpdateServerCardUsageStats(*credit_card);
|
| + database_->UpdateServerCardMetadata(*credit_card);
|
|
|
| Refresh();
|
| return;
|
| @@ -494,7 +494,7 @@ void PersonalDataManager::RecordUseOf(const AutofillDataModel& data_model) {
|
| if (profile->record_type() == AutofillProfile::LOCAL_PROFILE)
|
| database_->UpdateAutofillProfile(*profile);
|
| else if (profile->record_type() == AutofillProfile::SERVER_PROFILE)
|
| - database_->UpdateServerAddressUsageStats(*profile);
|
| + database_->UpdateServerAddressMetadata(*profile);
|
|
|
| Refresh();
|
| }
|
| @@ -645,29 +645,15 @@ void PersonalDataManager::UpdateServerCreditCard(
|
| Refresh();
|
| }
|
|
|
| +// TODO(crbug.com/680180): Update the function name in Android.
|
| 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& server_card : server_credit_cards_) {
|
| - if (credit_card.server_id() == server_card->server_id()) {
|
| - existing_credit_card = server_card.get();
|
| - break;
|
| - }
|
| - }
|
| - if (!existing_credit_card
|
| - || existing_credit_card->billing_address_id() ==
|
| - credit_card.billing_address_id()) {
|
| + if (is_off_the_record_ || !database_.get())
|
| return;
|
| - }
|
|
|
| - existing_credit_card->set_billing_address_id(
|
| - credit_card.billing_address_id());
|
| - database_->UpdateServerCardBillingAddress(*existing_credit_card);
|
| + database_->UpdateServerCardMetadata(credit_card);
|
|
|
| Refresh();
|
| }
|
|
|