OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_ADDRESS_SELECTION_COORDINATOR_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_COORDINATOR_H_ |
6 #define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_COORDINATOR_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_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_address_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 autofill { | 16 namespace autofill { |
17 class AutofillProfile; | 17 class AutofillProfile; |
18 } // namespace autofill | 18 } // namespace autofill |
19 | 19 |
20 @class ShippingAddressSelectionCoordinator; | 20 @class ShippingAddressSelectionCoordinator; |
21 | 21 |
22 // Delegate protocol for ShippingAddressSelectionCoordinator. | 22 // Delegate protocol for ShippingAddressSelectionCoordinator. |
23 @protocol ShippingAddressSelectionCoordinatorDelegate<NSObject> | 23 @protocol ShippingAddressSelectionCoordinatorDelegate<NSObject> |
24 | 24 |
25 // Notifies the delegate that the user has selected a shipping address. | 25 // Notifies the delegate that the user has selected a shipping address. |
26 - (void)shippingAddressSelectionCoordinator: | 26 - (void)shippingAddressSelectionCoordinator: |
27 (ShippingAddressSelectionCoordinator*)coordinator | 27 (ShippingAddressSelectionCoordinator*)coordinator |
28 didSelectShippingAddress: | 28 didSelectShippingAddress: |
29 (autofill::AutofillProfile*)shippingAddress; | 29 (autofill::AutofillProfile*)shippingAddress; |
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)shippingAddressSelectionCoordinatorDidReturn: | 33 - (void)shippingAddressSelectionCoordinatorDidReturn: |
34 (ShippingAddressSelectionCoordinator*)coordinator; | 34 (ShippingAddressSelectionCoordinator*)coordinator; |
35 | 35 |
36 @end | 36 @end |
37 | 37 |
38 // Coordinator responsible for creating and presenting the shipping address | 38 // Coordinator responsible for creating and presenting the shipping address |
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 ShippingAddressSelectionCoordinator | 41 @interface ShippingAddressSelectionCoordinator |
42 : ChromeCoordinator<ShippingAddressSelectionViewControllerDelegate> | 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 address or | 49 // The delegate to be notified when the user selects a shipping address or |
50 // returns without selecting one. | 50 // returns without selecting one. |
51 @property(nonatomic, weak) | 51 @property(nonatomic, weak) |
52 id<ShippingAddressSelectionCoordinatorDelegate> delegate; | 52 id<ShippingAddressSelectionCoordinatorDelegate> 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_ADDRESS_SELECTION_COORDINATOR_H_ | 59 #endif // IOS_CHROME_BROWSER_PAYMENTS_SHIPPING_ADDRESS_SELECTION_COORDINATOR_H_ |
OLD | NEW |