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

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

Issue 2703673002: [Merge-57] Add billing_address_id and has_converted to autofill_table (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | components/autofill/core/browser/webdata/autofill_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | components/autofill/core/browser/webdata/autofill_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698