OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_SELECTION_VIEW_CONTROLLER_H_ | |
6 #define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_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 web { | |
15 class PaymentShippingOption; | |
16 } // namespace web | |
17 | |
18 @class ShippingOptionSelectionViewController; | |
19 | |
20 // Delegate protocol for ShippingOptionSelectionViewController. | |
21 @protocol ShippingOptionSelectionViewControllerDelegate<NSObject> | |
22 | |
23 // Notifies the delegate that the user has selected a shipping option. | |
24 - (void)shippingOptionSelectionViewController: | |
25 (ShippingOptionSelectionViewController*)controller | |
26 didSelectShippingOption: | |
27 (web::PaymentShippingOption*)shippingOption; | |
28 | |
29 // Notifies the delegate that the user has chosen to return to the previous | |
30 // screen without making a selection. | |
31 - (void)shippingOptionSelectionViewControllerDidReturn: | |
32 (ShippingOptionSelectionViewController*)controller; | |
33 | |
34 @end | |
35 | |
36 // View controller responsible for presenting the available shipping options | |
37 // for selection by the user and communicating their choice to the supplied | |
38 // delegate. | |
39 @interface ShippingOptionSelectionViewController : CollectionViewController | |
40 | |
41 // Whether or not the view is in a pending state. | |
42 @property(nonatomic, assign, getter=isPending) BOOL pending; | |
43 | |
44 // The error message to display, if any. | |
45 @property(nonatomic, copy) NSString* errorMessage; | |
46 | |
47 // The delegate to be notified when the user selects a shipping option or | |
48 // returns without selecting one. | |
49 @property(nonatomic, weak) | |
50 id<ShippingOptionSelectionViewControllerDelegate> delegate; | |
51 | |
52 // Initializes this object with an instance of PaymentRequest which has a copy | |
53 // of web::PaymentRequest as provided by the page invoking the Payment Request | |
54 // API. This object will not take ownership of |paymentRequest|. | |
55 - (instancetype)initWithPaymentRequest:(PaymentRequest*)paymentRequest | |
56 NS_DESIGNATED_INITIALIZER; | |
57 | |
58 - (instancetype)init NS_UNAVAILABLE; | |
59 | |
60 - (instancetype)initWithStyle:(CollectionViewControllerStyle)style | |
61 NS_UNAVAILABLE; | |
62 | |
63 @end | |
64 | |
65 #endif // IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_SELECTION_VIEW_CONTROLLER
_H_ | |
OLD | NEW |