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 | |
12 class PaymentRequest; | |
13 | |
14 namespace autofill { | |
15 class CreditCard; | |
16 } // namespace autofill | |
17 | |
18 @class PaymentMethodSelectionViewController; | |
19 | |
20 // Delegate protocol for PaymentMethodSelectionViewController. | |
21 @protocol PaymentMethodSelectionViewControllerDelegate<NSObject> | |
22 | |
23 // Notifies the delegate that the user has selected a payment method. | |
24 - (void)paymentMethodSelectionViewController: | |
25 (PaymentMethodSelectionViewController*)controller | |
26 didSelectPaymentMethod: | |
27 (autofill::CreditCard*)paymentMethod; | |
28 | |
29 // Notifies the delegate that the user has chosen to return to the previous | |
30 // screen without making a selection. | |
31 - (void)paymentMethodSelectionViewControllerDidReturn: | |
32 (PaymentMethodSelectionViewController*)controller; | |
33 | |
34 // Notifies the delegate that the user has chosen to add a new credit card. | |
35 - (void)paymentMethodSelectionViewControllerDidSelectAddCard: | |
36 (PaymentMethodSelectionViewController*)controller; | |
37 | |
38 @end | |
39 | |
40 // View controller responsible for presenting the available payment methods for | |
41 // selection by the user and communicating their choice to the supplied | |
42 // delegate. Also offers a button to add a new payment method. | |
43 @interface PaymentMethodSelectionViewController : CollectionViewController | |
44 | |
45 // The delegate to be notified when the user selects a payment method or chooses | |
46 // to return without selecting one. | |
47 @property(nonatomic, weak) | |
48 id<PaymentMethodSelectionViewControllerDelegate> delegate; | |
49 | |
50 // Initializes this object with an instance of PaymentRequest which has a copy | |
51 // of web::PaymentRequest as provided by the page invoking the Payment Request | |
52 // API. This object will not take ownership of |paymentRequest|. | |
53 - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest | |
54 NS_DESIGNATED_INITIALIZER; | |
55 | |
56 - (instancetype)init NS_UNAVAILABLE; | |
57 | |
58 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style | |
59 NS_UNAVAILABLE; | |
60 | |
61 @end | |
62 | |
63 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_METHOD_SELECTION_VIEW_CONTROLLER_
H_ | |
OLD | NEW |