| 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_picker_view_controller.h
" | 5 #import "ios/chrome/browser/ui/payments/payment_request_picker_view_controller.h
" |
| 6 | 6 |
| 7 #import "base/logging.h" | 7 #import "base/logging.h" |
| 8 #import "base/mac/foundation_util.h" | 8 #import "base/mac/foundation_util.h" |
| 9 #import "ios/chrome/browser/ui/payments/payment_request_picker_row.h" | 9 #import "ios/chrome/browser/ui/payments/payment_request_picker_row.h" |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 [super viewDidLoad]; | 78 [super viewDidLoad]; |
| 79 | 79 |
| 80 self.tableView.rowHeight = 48.0f; // The same as MDCCellDefaultOneLineHeight. | 80 self.tableView.rowHeight = 48.0f; // The same as MDCCellDefaultOneLineHeight. |
| 81 self.tableView.accessibilityIdentifier = | 81 self.tableView.accessibilityIdentifier = |
| 82 kPaymentRequestPickerViewControllerAccessibilityID; | 82 kPaymentRequestPickerViewControllerAccessibilityID; |
| 83 | 83 |
| 84 self.searchController = | 84 self.searchController = |
| 85 [[UISearchController alloc] initWithSearchResultsController:nil]; | 85 [[UISearchController alloc] initWithSearchResultsController:nil]; |
| 86 self.searchController.searchResultsUpdater = self; | 86 self.searchController.searchResultsUpdater = self; |
| 87 self.searchController.dimsBackgroundDuringPresentation = NO; | 87 self.searchController.dimsBackgroundDuringPresentation = NO; |
| 88 self.searchController.hidesNavigationBarDuringPresentation = NO; |
| 88 self.searchController.searchBar.accessibilityIdentifier = | 89 self.searchController.searchBar.accessibilityIdentifier = |
| 89 kPaymentRequestPickerSearchBarAccessibilityID; | 90 kPaymentRequestPickerSearchBarAccessibilityID; |
| 90 self.tableView.tableHeaderView = self.searchController.searchBar; | 91 self.tableView.tableHeaderView = self.searchController.searchBar; |
| 91 | 92 |
| 92 // Presentation of searchController will walk up the view controller hierarchy | 93 // Presentation of searchController will walk up the view controller hierarchy |
| 93 // until it finds the root view controller or one that defines a presentation | 94 // until it finds the root view controller or one that defines a presentation |
| 94 // context. Make this class the presentation context so that the search | 95 // context. Make this class the presentation context so that the search |
| 95 // controller does not present on top of the navigation controller. | 96 // controller does not present on top of the navigation controller. |
| 96 self.definesPresentationContext = YES; | 97 self.definesPresentationContext = YES; |
| 97 } | 98 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // title for a row is the capitalized first letter of the label for that row. | 243 // title for a row is the capitalized first letter of the label for that row. |
| 243 - (NSString*)sectionTitleForRow:(PickerRow*)row { | 244 - (NSString*)sectionTitleForRow:(PickerRow*)row { |
| 244 return [[row.label substringToIndex:1] uppercaseString]; | 245 return [[row.label substringToIndex:1] uppercaseString]; |
| 245 } | 246 } |
| 246 | 247 |
| 247 - (NSString*)description { | 248 - (NSString*)description { |
| 248 return kPaymentRequestPickerViewControllerAccessibilityID; | 249 return kPaymentRequestPickerViewControllerAccessibilityID; |
| 249 } | 250 } |
| 250 | 251 |
| 251 @end | 252 @end |
| OLD | NEW |