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

Side by Side Diff: ios/chrome/browser/ui/payments/payment_request_edit_view_controller.mm

Issue 2907103002: [Payment Request] Updates PaymentRequestEditViewController in showcase (Closed)
Patch Set: Addressed comments + fixed broken build 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/showcase/payments/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 item.textFieldValue = field.value; 315 item.textFieldValue = field.value;
316 316
317 // Cache the options if there are any and set the text field's UIPickerView. 317 // Cache the options if there are any and set the text field's UIPickerView.
318 if (options.count) { 318 if (options.count) {
319 NSNumber* key = [NSNumber numberWithInt:field.autofillUIType]; 319 NSNumber* key = [NSNumber numberWithInt:field.autofillUIType];
320 [self.options setObject:options forKey:key]; 320 [self.options setObject:options forKey:key];
321 321
322 UIPickerView* pickerView = [[UIPickerView alloc] initWithFrame:CGRectZero]; 322 UIPickerView* pickerView = [[UIPickerView alloc] initWithFrame:CGRectZero];
323 pickerView.delegate = self; 323 pickerView.delegate = self;
324 pickerView.dataSource = self; 324 pickerView.dataSource = self;
325 pickerView.accessibilityIdentifier =
326 [NSString stringWithFormat:@"%@_pickerView", field.label];
325 [self.pickerViews setObject:pickerView forKey:key]; 327 [self.pickerViews setObject:pickerView forKey:key];
326 item.inputView = pickerView; 328 item.inputView = pickerView;
329
330 // Set UIPickerView's default selected row.
331 [pickerView reloadAllComponents];
332 [pickerView selectRow:[options indexOfObject:field.value]
333 inComponent:0
334 animated:NO];
327 } 335 }
328 336
329 // Reload the item. 337 // Reload the item.
330 NSIndexPath* indexPath = 338 NSIndexPath* indexPath =
331 [self.collectionViewModel indexPathForItemType:ItemTypeTextField 339 [self.collectionViewModel indexPathForItemType:ItemTypeTextField
332 sectionIdentifier:field.sectionIdentifier]; 340 sectionIdentifier:field.sectionIdentifier];
333 [self.collectionView reloadItemsAtIndexPaths:@[ indexPath ]]; 341 [self.collectionView reloadItemsAtIndexPaths:@[ indexPath ]];
334 } 342 }
335 343
336 #pragma mark - UITextFieldDelegate 344 #pragma mark - UITextFieldDelegate
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 [_currentEditingCell.textField resignFirstResponder]; 734 [_currentEditingCell.textField resignFirstResponder];
727 735
728 if (![self validateForm]) 736 if (![self validateForm])
729 return; 737 return;
730 738
731 [self.delegate paymentRequestEditViewController:self 739 [self.delegate paymentRequestEditViewController:self
732 didFinishEditingFields:self.fields]; 740 didFinishEditingFields:self.fields];
733 } 741 }
734 742
735 @end 743 @end
OLDNEW
« no previous file with comments | « no previous file | ios/showcase/payments/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698