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_PAYMENTS_SHIPPING_OPTION_SELECTION_COORDINATOR_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_SELECTION_COORDINATOR_H_ |
6 #define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_SELECTION_COORDINATOR_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_SELECTION_COORDINATOR_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #import "ios/chrome/browser/chrome_coordinator.h" | 11 #import "ios/chrome/browser/chrome_coordinator.h" |
12 #import "ios/chrome/browser/payments/shipping_option_selection_view_controller.h
" | 12 #import "ios/chrome/browser/payments/payment_request_selector_view_controller.h" |
13 | 13 |
14 class PaymentRequest; | 14 class PaymentRequest; |
15 | 15 |
16 namespace web { | 16 namespace web { |
17 class PaymentShippingOption; | 17 class PaymentShippingOption; |
18 } // namespace web | 18 } // namespace web |
19 | 19 |
20 @class ShippingOptionSelectionCoordinator; | 20 @class ShippingOptionSelectionCoordinator; |
21 | 21 |
22 // Delegate protocol for ShippingOptionSelectionCoordinator. | 22 // Delegate protocol for ShippingOptionSelectionCoordinator. |
23 @protocol ShippingOptionSelectionCoordinatorDelegate<NSObject> | 23 @protocol ShippingOptionSelectionCoordinatorDelegate<NSObject> |
24 | 24 |
25 // Notifies the delegate that the user has selected a shipping option. | 25 // Notifies the delegate that the user has selected a shipping option. |
26 - (void)shippingOptionSelectionCoordinator: | 26 - (void)shippingOptionSelectionCoordinator: |
27 (ShippingOptionSelectionCoordinator*)coordinator | 27 (ShippingOptionSelectionCoordinator*)coordinator |
28 didSelectShippingOption: | 28 didSelectShippingOption: |
29 (web::PaymentShippingOption*)shippingOption; | 29 (web::PaymentShippingOption*)shippingOption; |
30 | 30 |
31 // Notifies the delegate that the user has chosen to return to the previous | 31 // Notifies the delegate that the user has chosen to return to the previous |
32 // screen without making a selection. | 32 // screen without making a selection. |
33 - (void)shippingOptionSelectionCoordinatorDidReturn: | 33 - (void)shippingOptionSelectionCoordinatorDidReturn: |
34 (ShippingOptionSelectionCoordinator*)coordinator; | 34 (ShippingOptionSelectionCoordinator*)coordinator; |
35 | 35 |
36 @end | 36 @end |
37 | 37 |
38 // Coordinator responsible for creating and presenting the shipping option | 38 // Coordinator responsible for creating and presenting the shipping option |
39 // selection view controller. This view controller will be presented by the view | 39 // selection view controller. This view controller will be presented by the view |
40 // controller provided in the initializer. | 40 // controller provided in the initializer. |
41 @interface ShippingOptionSelectionCoordinator | 41 @interface ShippingOptionSelectionCoordinator |
42 : ChromeCoordinator<ShippingOptionSelectionViewControllerDelegate> | 42 : ChromeCoordinator<PaymentRequestSelectorViewControllerDelegate> |
43 | 43 |
44 // The PaymentRequest object having a copy of web::PaymentRequest as provided by | 44 // The PaymentRequest object having a copy of web::PaymentRequest as provided by |
45 // the page invoking the Payment Request API. This pointer is not owned by this | 45 // the page invoking the Payment Request API. This pointer is not owned by this |
46 // class and should outlive it. | 46 // class and should outlive it. |
47 @property(nonatomic, assign) PaymentRequest* paymentRequest; | 47 @property(nonatomic, assign) PaymentRequest* paymentRequest; |
48 | 48 |
49 // The delegate to be notified when the user selects a shipping option or | 49 // The delegate to be notified when the user selects a shipping option or |
50 // returns without selecting one. | 50 // returns without selecting one. |
51 @property(nonatomic, weak) | 51 @property(nonatomic, weak) |
52 id<ShippingOptionSelectionCoordinatorDelegate> delegate; | 52 id<ShippingOptionSelectionCoordinatorDelegate> delegate; |
53 | 53 |
54 // Stops the spinner and displays the error provided in the payment details. | 54 // Stops the spinner and displays the error provided in the payment details. |
55 - (void)stopSpinnerAndDisplayError; | 55 - (void)stopSpinnerAndDisplayError; |
56 | 56 |
57 @end | 57 @end |
58 | 58 |
59 #endif // IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_SELECTION_COORDINATOR_H_ | 59 #endif // IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_OPTION_SELECTION_COORDINATOR_H_ |
OLD | NEW |