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/showcase/payments/sc_payments_selector_coordinator.h" | 5 #import "ios/showcase/payments/sc_payments_selector_coordinator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h" | 8 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h" |
9 #import "ios/chrome/browser/ui/payments/cells/payments_has_accessory_type.h" | 9 #import "ios/chrome/browser/ui/payments/cells/payments_has_accessory_type.h" |
10 #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" | 10 #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 [self.selectorViewController loadModel]; | 62 [self.selectorViewController loadModel]; |
63 [self.selectorViewController | 63 [self.selectorViewController |
64 setDelegate:static_cast<id<PaymentRequestSelectorViewControllerDelegate>>( | 64 setDelegate:static_cast<id<PaymentRequestSelectorViewControllerDelegate>>( |
65 self.alerter)]; | 65 self.alerter)]; |
66 [self.baseViewController pushViewController:self.selectorViewController | 66 [self.baseViewController pushViewController:self.selectorViewController |
67 animated:YES]; | 67 animated:YES]; |
68 } | 68 } |
69 | 69 |
70 #pragma mark - PaymentRequestSelectorViewControllerDataSource | 70 #pragma mark - PaymentRequestSelectorViewControllerDataSource |
71 | 71 |
| 72 - (BOOL)allowsEditMode { |
| 73 return NO; |
| 74 } |
| 75 |
72 - (CollectionViewItem*)headerItem { | 76 - (CollectionViewItem*)headerItem { |
73 return [self createItemWithText:@"Header item"]; | 77 return [self createItemWithText:@"Header item"]; |
74 } | 78 } |
75 | 79 |
76 - (NSArray<CollectionViewItem<PaymentsHasAccessoryType>*>*)selectableItems { | 80 - (NSArray<CollectionViewItem<PaymentsHasAccessoryType>*>*)selectableItems { |
77 return self.items; | 81 return self.items; |
78 } | 82 } |
79 | 83 |
80 - (CollectionViewItem*)addButtonItem { | 84 - (CollectionViewItem*)addButtonItem { |
81 return [self createItemWithText:@"Add an item"]; | 85 return [self createItemWithText:@"Add an item"]; |
(...skipping 11 matching lines...) Expand all Loading... |
93 } | 97 } |
94 | 98 |
95 - (CollectionViewItem<PaymentsHasAccessoryType>*)createItemWithText: | 99 - (CollectionViewItem<PaymentsHasAccessoryType>*)createItemWithText: |
96 (NSString*)text { | 100 (NSString*)text { |
97 PaymentsTextItem* item = [[PaymentsTextItem alloc] init]; | 101 PaymentsTextItem* item = [[PaymentsTextItem alloc] init]; |
98 item.text = text; | 102 item.text = text; |
99 return item; | 103 return item; |
100 } | 104 } |
101 | 105 |
102 @end | 106 @end |
OLD | NEW |