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

Unified Diff: ios/chrome/browser/payments/payment_request_utils.mm

Issue 2588913002: EarlGrey tests for Payment Request (base CL) (Closed)
Patch Set: Addressed comments by jdonnelly@ Created 3 years, 12 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/payments/payment_request_utils.mm
diff --git a/ios/chrome/browser/payments/payment_request_utils.mm b/ios/chrome/browser/payments/payment_request_utils.mm
index bfe81e7ff4354f70dfcb5efeec824fdd4bb5ab82..a5637abc795212ba2f6a61840a75513c18f6438f 100644
--- a/ios/chrome/browser/payments/payment_request_utils.mm
+++ b/ios/chrome/browser/payments/payment_request_utils.mm
@@ -6,10 +6,17 @@
#include "base/strings/sys_string_conversions.h"
#include "components/autofill/core/browser/autofill_profile.h"
+#include "components/autofill/core/browser/field_types.h"
#include "ios/chrome/browser/application_context.h"
namespace payment_request_utils {
+NSString* NameLabelFromAutofillProfile(autofill::AutofillProfile* profile) {
+ return base::SysUTF16ToNSString(
+ profile->GetInfo(autofill::AutofillType(autofill::NAME_FULL),
+ GetApplicationContext()->GetApplicationLocale()));
+}
+
NSString* AddressLabelFromAutofillProfile(autofill::AutofillProfile* profile) {
// Name, company, and country are not included in the shipping address label.
std::vector<autofill::ServerFieldType> label_fields;
@@ -26,4 +33,11 @@ NSString* AddressLabelFromAutofillProfile(autofill::AutofillProfile* profile) {
GetApplicationContext()->GetApplicationLocale()));
}
+NSString* PhoneNumberLabelFromAutofillProfile(
+ autofill::AutofillProfile* profile) {
+ return base::SysUTF16ToNSString(profile->GetInfo(
+ autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER),
+ GetApplicationContext()->GetApplicationLocale()));
+}
+
} // namespace payment_request_utils

Powered by Google App Engine
This is Rietveld 408576698