Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 2626843004: [Payments] Add billing_address_id and has_converted to autofill_table (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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())
please use gerrit instead 2017/01/11 19:23:03 I don't see why off the record should prevent upda
sebsg 2017/01/12 15:36:30 off the record is currently used to avoid modifyin
return;
- }
- existing_credit_card->set_billing_address_id(
- credit_card.billing_address_id());
- database_->UpdateServerCardBillingAddress(*existing_credit_card);
+ database_->UpdateServerCardMetadata(credit_card);
Refresh();
}

Powered by Google App Engine
This is Rietveld 408576698