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

Unified Diff: ios/chrome/browser/ui/settings/autofill_credit_card_edit_collection_view_controller.mm

Issue 2956433002: [Payment Request] keyboardType, autoCapitalizationType, etc for text fields (Closed)
Patch Set: 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/settings/autofill_credit_card_edit_collection_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/autofill_credit_card_edit_collection_view_controller.mm b/ios/chrome/browser/ui/settings/autofill_credit_card_edit_collection_view_controller.mm
index 24ef3f666a297adbbdaeeaba30215a96d092df1e..d90d44d1562cc43fdadb79813eb0396738b31c6d 100644
--- a/ios/chrome/browser/ui/settings/autofill_credit_card_edit_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/autofill_credit_card_edit_collection_view_controller.mm
@@ -164,6 +164,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
: base::SysUTF16ToNSString(_creditCard.LastFourDigits());
cardNumberitem.textFieldEnabled = isEditing;
cardNumberitem.autofillUIType = AutofillUITypeCreditCardNumber;
+ cardNumberitem.keyboardType = UIKeyboardTypeNumberPad;
cardNumberitem.identifyingIcon =
[self cardTypeIconFromCardNumber:cardNumberitem.textFieldValue];
[model addItem:cardNumberitem
@@ -178,6 +179,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
[NSString stringWithFormat:@"%02d", _creditCard.expiration_month()];
expirationMonthItem.textFieldEnabled = isEditing;
expirationMonthItem.autofillUIType = AutofillUITypeCreditCardExpMonth;
+ expirationMonthItem.keyboardType = UIKeyboardTypeNumberPad;
[model addItem:expirationMonthItem
toSectionWithIdentifier:SectionIdentifierFields];
@@ -190,6 +192,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
[NSString stringWithFormat:@"%04d", _creditCard.expiration_year()];
expirationYearItem.textFieldEnabled = isEditing;
expirationYearItem.autofillUIType = AutofillUITypeCreditCardExpYear;
+ expirationYearItem.keyboardType = UIKeyboardTypeNumberPad;
+ expirationYearItem.returnKeyType = UIReturnKeyDone;
[model addItem:expirationYearItem
toSectionWithIdentifier:SectionIdentifierFields];
@@ -262,28 +266,9 @@ typedef NS_ENUM(NSInteger, ItemType) {
textFieldCell.textField.delegate = self;
switch (itemType) {
case ItemTypeCardholderName:
- textFieldCell.textField.autocapitalizationType =
- UITextAutocapitalizationTypeWords;
- textFieldCell.textField.keyboardType = UIKeyboardTypeDefault;
- textFieldCell.textField.returnKeyType = UIReturnKeyNext;
- break;
case ItemTypeCardNumber:
- textFieldCell.textField.autocapitalizationType =
- UITextAutocapitalizationTypeSentences;
- textFieldCell.textField.keyboardType = UIKeyboardTypeNumberPad;
- textFieldCell.textField.returnKeyType = UIReturnKeyNext;
- break;
case ItemTypeExpirationMonth:
- textFieldCell.textField.autocapitalizationType =
- UITextAutocapitalizationTypeSentences;
- textFieldCell.textField.keyboardType = UIKeyboardTypeNumberPad;
- textFieldCell.textField.returnKeyType = UIReturnKeyNext;
- break;
case ItemTypeExpirationYear:
- textFieldCell.textField.autocapitalizationType =
- UITextAutocapitalizationTypeSentences;
- textFieldCell.textField.keyboardType = UIKeyboardTypeNumberPad;
- textFieldCell.textField.returnKeyType = UIReturnKeyDone;
break;
case ItemTypeCopiedToChrome: {
CopiedToChromeCell* copiedToChromeCell =

Powered by Google App Engine
This is Rietveld 408576698