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

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

Issue 1042353003: Create syncable metadata table for Wallet credit cards and addresses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment about migration code Created 5 years, 8 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 0e10852ef13b8ca07f890a31b40b2bfddc7b57e2..b7a0a46e0cfea0ac59b7cce98dd670f788ead666 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -517,16 +517,10 @@ void PersonalDataManager::RecordUseOf(const AutofillDataModel& data_model) {
if (credit_card) {
credit_card->RecordUse();
- if (credit_card->record_type() == CreditCard::LOCAL_CARD) {
+ if (credit_card->record_type() == CreditCard::LOCAL_CARD)
database_->UpdateCreditCard(*credit_card);
- } else if (credit_card->record_type() == CreditCard::FULL_SERVER_CARD) {
- database_->UpdateUnmaskedCardUsageStats(*credit_card);
- } else {
- // It's possible to get a masked server card here if the user decides not
- // to store a card while verifying it. We don't currently track usage
- // of masked cards, so no-op.
- return;
- }
+ else
+ database_->UpdateServerCardUsageStats(*credit_card);
Refresh();
return;
@@ -535,7 +529,12 @@ void PersonalDataManager::RecordUseOf(const AutofillDataModel& data_model) {
AutofillProfile* profile = GetProfileByGUID(data_model.guid());
if (profile) {
profile->RecordUse();
- database_->UpdateAutofillProfile(*profile);
+
+ if (profile->record_type() == AutofillProfile::LOCAL_PROFILE)
+ database_->UpdateAutofillProfile(*profile);
+ else if (profile->record_type() == AutofillProfile::SERVER_PROFILE)
+ database_->UpdateServerAddressUsageStats(*profile);
+
Refresh();
}
}
@@ -673,7 +672,7 @@ void PersonalDataManager::UpdateServerCreditCard(
DCHECK_NE(existing_credit_card->record_type(), credit_card.record_type());
DCHECK_EQ(existing_credit_card->Label(), credit_card.Label());
if (existing_credit_card->record_type() == CreditCard::MASKED_SERVER_CARD) {
- database_->UnmaskServerCreditCard(credit_card.server_id(),
+ database_->UnmaskServerCreditCard(credit_card,
credit_card.number());
} else {
database_->MaskServerCreditCard(credit_card.server_id());

Powered by Google App Engine
This is Rietveld 408576698