| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller.h" | 5 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/foundation_util.h" | 8 #import "base/mac/foundation_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "components/strings/grit/components_strings.h" | 10 #include "components/strings/grit/components_strings.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 [model addSectionWithIdentifier:sectionIdentifier]; | 243 [model addSectionWithIdentifier:sectionIdentifier]; |
| 244 switch (field.fieldType) { | 244 switch (field.fieldType) { |
| 245 case EditorFieldTypeTextField: { | 245 case EditorFieldTypeTextField: { |
| 246 AutofillEditItem* item = | 246 AutofillEditItem* item = |
| 247 [[AutofillEditItem alloc] initWithType:ItemTypeTextField]; | 247 [[AutofillEditItem alloc] initWithType:ItemTypeTextField]; |
| 248 item.textFieldName = field.label; | 248 item.textFieldName = field.label; |
| 249 item.textFieldEnabled = field.enabled; | 249 item.textFieldEnabled = field.enabled; |
| 250 item.textFieldValue = field.value; | 250 item.textFieldValue = field.value; |
| 251 item.required = field.isRequired; | 251 item.required = field.isRequired; |
| 252 item.autofillUIType = field.autofillUIType; | 252 item.autofillUIType = field.autofillUIType; |
| 253 item.returnKeyType = field.returnKeyType; |
| 254 item.keyboardType = field.keyboardType; |
| 255 item.autoCapitalizationType = field.autoCapitalizationType; |
| 253 item.identifyingIcon = [_dataSource iconIdentifyingEditorField:field]; | 256 item.identifyingIcon = [_dataSource iconIdentifyingEditorField:field]; |
| 254 [model addItem:item toSectionWithIdentifier:sectionIdentifier]; | 257 [model addItem:item toSectionWithIdentifier:sectionIdentifier]; |
| 255 field.item = item; | 258 field.item = item; |
| 256 | 259 |
| 257 break; | 260 break; |
| 258 } | 261 } |
| 259 case EditorFieldTypeSelector: { | 262 case EditorFieldTypeSelector: { |
| 260 PaymentsSelectorEditItem* item = [[PaymentsSelectorEditItem alloc] | 263 PaymentsSelectorEditItem* item = [[PaymentsSelectorEditItem alloc] |
| 261 initWithType:ItemTypeSelectorField]; | 264 initWithType:ItemTypeSelectorField]; |
| 262 item.name = field.label; | 265 item.name = field.label; |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 [_currentEditingCell.textField resignFirstResponder]; | 772 [_currentEditingCell.textField resignFirstResponder]; |
| 770 | 773 |
| 771 if (![self validateForm]) | 774 if (![self validateForm]) |
| 772 return; | 775 return; |
| 773 | 776 |
| 774 [self.delegate paymentRequestEditViewController:self | 777 [self.delegate paymentRequestEditViewController:self |
| 775 didFinishEditingFields:self.fields]; | 778 didFinishEditingFields:self.fields]; |
| 776 } | 779 } |
| 777 | 780 |
| 778 @end | 781 @end |
| OLD | NEW |