| 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 d2a931c0d2b3453dd07752fa471eedb3d55e245c..88096ec268add4bf40bbdcdcd09c9135b5dddcf2 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();
|
| }
|
| @@ -649,25 +649,10 @@ void PersonalDataManager::UpdateServerCardMetadata(
|
| 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();
|
| }
|
|
|