| Index: ios/chrome/browser/ui/payments/address_edit_mediator.mm
|
| diff --git a/ios/chrome/browser/ui/payments/address_edit_mediator.mm b/ios/chrome/browser/ui/payments/address_edit_mediator.mm
|
| index 19a2834e4a32e8cc85f4f058409c3fe70d4a16d5..2dbc06b44bbb7466922935d8e7f1d224fcf83fc5 100644
|
| --- a/ios/chrome/browser/ui/payments/address_edit_mediator.mm
|
| +++ b/ios/chrome/browser/ui/payments/address_edit_mediator.mm
|
| @@ -21,6 +21,7 @@
|
| #include "components/autofill/core/browser/country_combobox_model.h"
|
| #include "components/autofill/core/browser/field_types.h"
|
| #include "components/autofill/core/browser/personal_data_manager.h"
|
| +#include "components/payments/core/payment_request_data_util.h"
|
| #include "components/strings/grit/components_strings.h"
|
| #include "ios/chrome/browser/application_context.h"
|
| #include "ios/chrome/browser/payments/payment_request.h"
|
| @@ -119,6 +120,15 @@
|
| return NO;
|
| }
|
|
|
| +- (void)formatValueForEditorField:(EditorField*)field {
|
| + if (field.autofillUIType == AutofillUITypeProfileHomePhoneWholeNumber) {
|
| + field.value =
|
| + base::SysUTF8ToNSString(payments::data_util::FormatPhoneForDisplay(
|
| + base::SysNSStringToUTF8(field.value),
|
| + base::SysNSStringToUTF8(self.selectedCountryCode)));
|
| + }
|
| +}
|
| +
|
| - (UIImage*)iconIdentifyingEditorField:(EditorField*)field {
|
| return nil;
|
| }
|
| @@ -299,8 +309,12 @@
|
| EditorField* field = self.fieldsMap[phoneNumberFieldKey];
|
| if (!field) {
|
| NSString* value =
|
| - [self fieldValueFromProfile:self.address
|
| - fieldType:autofill::PHONE_HOME_WHOLE_NUMBER];
|
| + self.address
|
| + ? base::SysUTF16ToNSString(
|
| + payments::data_util::GetFormattedPhoneNumberForDisplay(
|
| + *self.address,
|
| + GetApplicationContext()->GetApplicationLocale()))
|
| + : nil;
|
| field = [[EditorField alloc]
|
| initWithAutofillUIType:AutofillUITypeProfileHomePhoneWholeNumber
|
| fieldType:EditorFieldTypeTextField
|
|
|