| Index: ios/chrome/browser/payments/payment_request_util.mm
|
| diff --git a/ios/chrome/browser/payments/payment_request_util.mm b/ios/chrome/browser/payments/payment_request_util.mm
|
| index ceb9ef7c2ac4c093005317193b8fa39a22e40d91..99c53f2330e059ff459b8b01c4f7401dfe2a7bdb 100644
|
| --- a/ios/chrome/browser/payments/payment_request_util.mm
|
| +++ b/ios/chrome/browser/payments/payment_request_util.mm
|
| @@ -9,7 +9,6 @@
|
| #include "base/strings/sys_string_conversions.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "components/autofill/core/browser/autofill_profile.h"
|
| -#include "components/autofill/core/browser/credit_card.h"
|
| #include "components/autofill/core/browser/field_types.h"
|
| #include "components/autofill/core/browser/personal_data_manager.h"
|
| #include "components/strings/grit/components_strings.h"
|
| @@ -62,58 +61,6 @@ NSString* GetEmailLabelFromAutofillProfile(
|
| return !label.empty() ? base::SysUTF16ToNSString(label) : nil;
|
| }
|
|
|
| -web::PaymentAddress GetPaymentAddressFromAutofillProfile(
|
| - const autofill::AutofillProfile& profile) {
|
| - web::PaymentAddress address;
|
| - address.country = profile.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY);
|
| - address.address_line = base::SplitString(
|
| - profile.GetInfo(
|
| - autofill::AutofillType(autofill::ADDRESS_HOME_STREET_ADDRESS),
|
| - GetApplicationContext()->GetApplicationLocale()),
|
| - base::ASCIIToUTF16("\n"), base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
|
| - address.region = profile.GetRawInfo(autofill::ADDRESS_HOME_STATE);
|
| - address.city = profile.GetRawInfo(autofill::ADDRESS_HOME_CITY);
|
| - address.dependent_locality =
|
| - profile.GetRawInfo(autofill::ADDRESS_HOME_DEPENDENT_LOCALITY);
|
| - address.postal_code = profile.GetRawInfo(autofill::ADDRESS_HOME_ZIP);
|
| - address.sorting_code =
|
| - profile.GetRawInfo(autofill::ADDRESS_HOME_SORTING_CODE);
|
| - address.language_code = base::UTF8ToUTF16(profile.language_code());
|
| - address.organization = profile.GetRawInfo(autofill::COMPANY_NAME);
|
| - address.recipient =
|
| - profile.GetInfo(autofill::AutofillType(autofill::NAME_FULL),
|
| - GetApplicationContext()->GetApplicationLocale());
|
| - address.phone = profile.GetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER);
|
| -
|
| - return address;
|
| -}
|
| -
|
| -web::BasicCardResponse GetBasicCardResponseFromAutofillCreditCard(
|
| - const PaymentRequest& payment_request,
|
| - const autofill::CreditCard& card,
|
| - const base::string16& cvc) {
|
| - web::BasicCardResponse response;
|
| - response.cardholder_name = card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL);
|
| - response.card_number = card.GetRawInfo(autofill::CREDIT_CARD_NUMBER);
|
| - response.expiry_month = card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH);
|
| - response.expiry_year =
|
| - 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(), payment_request.billing_profiles());
|
| - DCHECK(billing_address);
|
| - response.billing_address =
|
| - GetPaymentAddressFromAutofillProfile(*billing_address);
|
| - }
|
| -
|
| - return response;
|
| -}
|
| -
|
| NSString* GetShippingSectionTitle(const PaymentRequest& payment_request) {
|
| switch (payment_request.payment_options().shipping_type) {
|
| case web::PaymentShippingType::SHIPPING:
|
|
|