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

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

Issue 2109643003: Add billing address to masked server credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add version_66.sql to the build file. Created 4 years, 6 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 9f766ea3f9f281c2e2b1debb554667d13f8f3f10..d6c311f22c2a7d11bf4cf4b410de6cab85c11d23 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -585,6 +585,33 @@ void PersonalDataManager::UpdateServerCreditCard(
Refresh();
}
+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 it : server_credit_cards_) {
+ if (credit_card.guid() == it->guid()) {
+ existing_credit_card = it;
+ break;
+ }
+ }
+ if (!existing_credit_card
+ || existing_credit_card->billing_address_id() ==
+ credit_card.billing_address_id()) {
+ return;
+ }
+
+ existing_credit_card->set_billing_address_id(
+ credit_card.billing_address_id());
+ database_->UpdateServerCardBillingAddress(*existing_credit_card);
+
+ Refresh();
+}
+
void PersonalDataManager::ResetFullServerCard(const std::string& guid) {
for (const CreditCard* card : server_credit_cards_) {
if (card->guid() == guid) {
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.h ('k') | components/autofill/core/browser/webdata/autofill_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698