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

Unified Diff: ios/chrome/browser/ui/payments/credit_card_edit_coordinator.mm

Issue 2949813003: [Payment Request] Formats phone number and credit card number in editors. (Closed)
Patch Set: Fixed broken tests Created 3 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: ios/chrome/browser/ui/payments/credit_card_edit_coordinator.mm
diff --git a/ios/chrome/browser/ui/payments/credit_card_edit_coordinator.mm b/ios/chrome/browser/ui/payments/credit_card_edit_coordinator.mm
index 63f1c2e4afe92dd1d0f47d721b396356605d0c20..4fceb55f3165935993d18dfcb08415d902e5a343 100644
--- a/ios/chrome/browser/ui/payments/credit_card_edit_coordinator.mm
+++ b/ios/chrome/browser/ui/payments/credit_card_edit_coordinator.mm
@@ -8,12 +8,14 @@
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/common/autofill_constants.h"
#import "components/autofill/ios/browser/credit_card_util.h"
#include "components/strings/grit/components_strings.h"
+#include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/payments/payment_request.h"
#import "ios/chrome/browser/ui/autofill/autofill_ui_type_util.h"
#import "ios/chrome/browser/ui/payments/credit_card_edit_mediator.h"
@@ -187,9 +189,10 @@ bool IsValidCreditCardNumber(const base::string16& card_number,
} else if (field.autofillUIType == AutofillUITypeCreditCardBillingAddress) {
creditCard.set_billing_address_id(base::SysNSStringToUTF8(field.value));
} else {
- creditCard.SetRawInfo(
- AutofillTypeFromAutofillUIType(field.autofillUIType),
- base::SysNSStringToUTF16(field.value));
+ creditCard.SetInfo(autofill::AutofillType(AutofillTypeFromAutofillUIType(
+ field.autofillUIType)),
+ base::SysNSStringToUTF16(field.value),
+ GetApplicationContext()->GetApplicationLocale());
}
}

Powered by Google App Engine
This is Rietveld 408576698