| 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 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
H_ |
| 6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
H_ | 6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" | 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
| 11 #import "ios/chrome/browser/ui/payments/payment_request_selector_view_controller
_data_source.h" |
| 11 | 12 |
| 12 @class PaymentRequestSelectorViewController; | 13 @class PaymentRequestSelectorViewController; |
| 13 @protocol PaymentRequestSelectorViewControllerDataSource; | |
| 14 | 14 |
| 15 // Delegate protocol for PaymentRequestSelectorViewController. | 15 // Delegate protocol for PaymentRequestSelectorViewController. |
| 16 @protocol PaymentRequestSelectorViewControllerDelegate<NSObject> | 16 @protocol PaymentRequestSelectorViewControllerDelegate<NSObject> |
| 17 | 17 |
| 18 // Notifies the delegate that the user has selected an item at the given index. | 18 // Notifies the delegate that the user has selected an item at the given index. |
| 19 - (void)paymentRequestSelectorViewController: | 19 - (void)paymentRequestSelectorViewController: |
| 20 (PaymentRequestSelectorViewController*)controller | 20 (PaymentRequestSelectorViewController*)controller |
| 21 didSelectItemAtIndex:(NSUInteger)index; | 21 didSelectItemAtIndex:(NSUInteger)index; |
| 22 | 22 |
| 23 // Notifies the delegate that the user has chosen to return to the previous | 23 // Notifies the delegate that the user has chosen to return to the previous |
| 24 // screen without making a selection. | 24 // screen without making a selection. |
| 25 - (void)paymentRequestSelectorViewControllerDidFinish: | 25 - (void)paymentRequestSelectorViewControllerDidFinish: |
| 26 (PaymentRequestSelectorViewController*)controller; | 26 (PaymentRequestSelectorViewController*)controller; |
| 27 | 27 |
| 28 @optional | 28 @optional |
| 29 | 29 |
| 30 // Notifies the delegate that the user has chosen to add an item. | 30 // Notifies the delegate that the user has chosen to add an item. |
| 31 - (void)paymentRequestSelectorViewControllerDidSelectAddItem: | 31 - (void)paymentRequestSelectorViewControllerDidSelectAddItem: |
| 32 (PaymentRequestSelectorViewController*)controller; | 32 (PaymentRequestSelectorViewController*)controller; |
| 33 | 33 |
| 34 // Notifies the delegate if the editing mode was toggled on or off. |
| 35 - (void)paymentRequestSelectorViewControllerDidToggleEditingMode: |
| 36 (PaymentRequestSelectorViewController*)controller; |
| 37 |
| 38 // Notifies the delegate that the user has chosen to edit an item at |index|. |
| 39 - (void)paymentRequestSelectorViewController: |
| 40 (PaymentRequestSelectorViewController*)controller |
| 41 didSelectItemAtIndexForEditing:(NSUInteger)index; |
| 42 |
| 34 @end | 43 @end |
| 35 | 44 |
| 36 // View controller responsible for presenting a list of items provided by the | 45 // View controller responsible for presenting a list of items provided by the |
| 37 // supplied data source for selection by the user and communicating the choice | 46 // supplied data source for selection by the user and communicating the choice |
| 38 // to the supplied delegate. It displays an optional header item provided by the | 47 // to the supplied delegate. It displays an optional header item provided by the |
| 39 // data source above the list of selectable items. The list is followed by an | 48 // data source above the list of selectable items. The list is followed by an |
| 40 // optional button to add an item. | 49 // optional button to add an item. |
| 41 @interface PaymentRequestSelectorViewController : CollectionViewController | 50 @interface PaymentRequestSelectorViewController : CollectionViewController |
| 42 | 51 |
| 43 // The delegate to be notified when the user selects an item, returns without | 52 // The delegate to be notified when the user selects an item, returns without |
| 44 // selection, or decides to add an item. | 53 // selection, or decides to add an item. |
| 45 @property(nonatomic, weak) id<PaymentRequestSelectorViewControllerDelegate> | 54 @property(nonatomic, weak) id<PaymentRequestSelectorViewControllerDelegate> |
| 46 delegate; | 55 delegate; |
| 47 | 56 |
| 48 // The data source for this view controller. | 57 // The data source for this view controller. |
| 49 @property(nonatomic, weak) id<PaymentRequestSelectorViewControllerDataSource> | 58 @property(nonatomic, weak) id<PaymentRequestSelectorViewControllerDataSource> |
| 50 dataSource; | 59 dataSource; |
| 51 | 60 |
| 52 // Convenience initializer. Initializes this object with the | 61 // Convenience initializer. Initializes this object with the |
| 53 // CollectionViewControllerStyleAppBar style and sets up the leading (back) | 62 // CollectionViewControllerStyleAppBar style and sets up the leading (back) |
| 54 // button. | 63 // button. |
| 55 - (instancetype)init; | 64 - (instancetype)init; |
| 56 | 65 |
| 57 @end | 66 @end |
| 58 | 67 |
| 59 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLL
ER_H_ | 68 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLL
ER_H_ |
| OLD | NEW |