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

Unified Diff: components/payments/core/payment_request_data_util.cc

Issue 2842463002: [Payments] Normalize billing address for response on Desktop. (Closed)
Patch Set: Addressed moe's comments Created 3 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/payments/core/payment_request_data_util.cc
diff --git a/components/payments/core/payment_request_data_util.cc b/components/payments/core/payment_request_data_util.cc
index 596a20e8ba5950a615ee05c4a79ef5926fe724b5..3fd13c913d0a4478dc9c9fa2e944fcb741c6a757 100644
--- a/components/payments/core/payment_request_data_util.cc
+++ b/components/payments/core/payment_request_data_util.cc
@@ -71,7 +71,7 @@ PaymentAddress GetPaymentAddressFromAutofillProfile(
BasicCardResponse GetBasicCardResponseFromAutofillCreditCard(
const autofill::CreditCard& card,
const base::string16& cvc,
- const std::vector<autofill::AutofillProfile*>& billing_profiles,
+ const autofill::AutofillProfile& billing_profile,
const std::string& app_locale) {
BasicCardResponse response;
response.cardholder_name = card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL);
@@ -81,16 +81,8 @@ BasicCardResponse GetBasicCardResponseFromAutofillCreditCard(
card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR);
response.card_security_code = cvc;
- // TODO(crbug.com/602666): Ensure we reach here only if the card has a billing
- // address. Then add DCHECK(!card->billing_address_id().empty()).
- if (!card.billing_address_id().empty()) {
- const autofill::AutofillProfile* billing_address =
- autofill::PersonalDataManager::GetProfileFromProfilesByGUID(
- card.billing_address_id(), billing_profiles);
- DCHECK(billing_address);
- response.billing_address =
- GetPaymentAddressFromAutofillProfile(*billing_address, app_locale);
- }
+ response.billing_address =
+ GetPaymentAddressFromAutofillProfile(billing_profile, app_locale);
return response;
}
« no previous file with comments | « components/payments/core/payment_request_data_util.h ('k') | components/payments/core/payment_request_data_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698