OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_METHOD_SELECTION_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_METHOD_SELECTION_VIEW_CONTROLLER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
| 11 #include "ios/web/public/payments/payment_request.h" |
| 12 |
| 13 namespace autofill { |
| 14 class CreditCard; |
| 15 } |
| 16 |
| 17 @class PaymentMethodSelectionViewController; |
| 18 |
| 19 @protocol PaymentMethodSelectionViewControllerDelegate<NSObject> |
| 20 |
| 21 - (void)paymentMethodSelectionViewController: |
| 22 (PaymentMethodSelectionViewController*)controller |
| 23 selectedPaymentMethod: |
| 24 (autofill::CreditCard*)paymentMethod; |
| 25 - (void)paymentMethodSelectionViewControllerDidReturn: |
| 26 (PaymentMethodSelectionViewController*)controller; |
| 27 |
| 28 @end |
| 29 |
| 30 // View controller responsible for presenting the available payment methods for |
| 31 // selection by the user and communicating their choice to the supplied |
| 32 // delegate. Also offers a button to add a new payment method. |
| 33 @interface PaymentMethodSelectionViewController : CollectionViewController |
| 34 |
| 35 // The payment methods available to fulfill the payment request. |
| 36 @property(nonatomic, assign) std::vector<autofill::CreditCard*> paymentMethods; |
| 37 |
| 38 // The payment method selected by the user, if any. |
| 39 @property(nonatomic, assign) autofill::CreditCard* selectedPaymentMethod; |
| 40 |
| 41 // The delegate to be notified when the user selects a payment method or chooses |
| 42 // to return without selecting one. |
| 43 @property(nonatomic, weak) id<PaymentMethodSelectionViewControllerDelegate> |
| 44 delegate; |
| 45 |
| 46 - (instancetype)init NS_DESIGNATED_INITIALIZER; |
| 47 |
| 48 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style |
| 49 NS_UNAVAILABLE; |
| 50 |
| 51 @end |
| 52 |
| 53 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_METHOD_SELECTION_VIEW_CONTROLLER_
H_ |
OLD | NEW |