| 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_PAYMENT_REQUEST_COORDINATOR_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_COORDINATOR_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_COORDINATOR_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_COORDINATOR_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #include "base/ios/block_types.h" | 10 #include "base/ios/block_types.h" |
| 11 #include "components/autofill/core/browser/autofill_manager.h" | 11 #include "components/autofill/core/browser/autofill_manager.h" |
| 12 #import "ios/chrome/browser/chrome_coordinator.h" | 12 #import "ios/chrome/browser/chrome_coordinator.h" |
| 13 #import "ios/chrome/browser/payments/payment_items_display_coordinator.h" | 13 #import "ios/chrome/browser/payments/payment_items_display_coordinator.h" |
| 14 #import "ios/chrome/browser/payments/payment_method_selection_coordinator.h" | 14 #import "ios/chrome/browser/payments/payment_method_selection_coordinator.h" |
| 15 #include "ios/chrome/browser/payments/payment_request.h" | 15 #include "ios/chrome/browser/payments/payment_request.h" |
| 16 #include "ios/chrome/browser/payments/payment_request_error_coordinator.h" | 16 #include "ios/chrome/browser/payments/payment_request_error_coordinator.h" |
| 17 #import "ios/chrome/browser/payments/payment_request_view_controller.h" | 17 #import "ios/chrome/browser/payments/payment_request_view_controller.h" |
| 18 #import "ios/chrome/browser/payments/shipping_address_selection_coordinator.h" | 18 #import "ios/chrome/browser/payments/shipping_address_selection_coordinator.h" |
| 19 #import "ios/chrome/browser/payments/shipping_option_selection_coordinator.h" | 19 #import "ios/chrome/browser/payments/shipping_option_selection_coordinator.h" |
| 20 | 20 |
| 21 namespace ios { | 21 namespace ios { |
| 22 class ChromeBrowserState; | 22 class ChromeBrowserState; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace payments { |
| 26 struct PaymentAddress; |
| 27 } |
| 28 |
| 25 @class PaymentRequestCoordinator; | 29 @class PaymentRequestCoordinator; |
| 26 | 30 |
| 27 // Delegate protocol for PaymentRequestCoordinator. | 31 // Delegate protocol for PaymentRequestCoordinator. |
| 28 @protocol PaymentRequestCoordinatorDelegate<NSObject> | 32 @protocol PaymentRequestCoordinatorDelegate<NSObject> |
| 29 | 33 |
| 30 // Notifies the delegate that the user has canceled the payment request. | 34 // Notifies the delegate that the user has canceled the payment request. |
| 31 - (void)paymentRequestCoordinatorDidCancel: | 35 - (void)paymentRequestCoordinatorDidCancel: |
| 32 (PaymentRequestCoordinator*)coordinator; | 36 (PaymentRequestCoordinator*)coordinator; |
| 33 | 37 |
| 34 // Notifies the delegate that the user has confirmed the payment request. | 38 // Notifies the delegate that the user has confirmed the payment request. |
| 35 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator | 39 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator |
| 36 didConfirmWithPaymentResponse:(web::PaymentResponse)paymentResponse; | 40 didConfirmWithPaymentResponse:(web::PaymentResponse)paymentResponse; |
| 37 | 41 |
| 38 // Notifies the delegate that the user has selected a shipping address. | 42 // Notifies the delegate that the user has selected a shipping address. |
| 39 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator | 43 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator |
| 40 didSelectShippingAddress:(web::PaymentAddress)shippingAddress; | 44 didSelectShippingAddress:(payments::PaymentAddress)shippingAddress; |
| 41 | 45 |
| 42 // Notifies the delegate that the user has selected a shipping option. | 46 // Notifies the delegate that the user has selected a shipping option. |
| 43 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator | 47 - (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator |
| 44 didSelectShippingOption:(web::PaymentShippingOption)shippingOption; | 48 didSelectShippingOption:(web::PaymentShippingOption)shippingOption; |
| 45 | 49 |
| 46 @end | 50 @end |
| 47 | 51 |
| 48 // Coordinator responsible for creating and presenting the PaymentRequest view | 52 // Coordinator responsible for creating and presenting the PaymentRequest view |
| 49 // controller. The PR view controller will be presented by the view controller | 53 // controller. The PR view controller will be presented by the view controller |
| 50 // provided in the initializer. | 54 // provided in the initializer. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Called when a credit card has been successfully unmasked. Note that |card| | 97 // Called when a credit card has been successfully unmasked. Note that |card| |
| 94 // may be different from what's returned by the selected_credit_card() method of | 98 // may be different from what's returned by the selected_credit_card() method of |
| 95 // |paymentRequest|, because CVC unmasking process may update the credit card | 99 // |paymentRequest|, because CVC unmasking process may update the credit card |
| 96 // number and expiration date. | 100 // number and expiration date. |
| 97 - (void)fullCardRequestDidSucceedWithCard:(const autofill::CreditCard&)card | 101 - (void)fullCardRequestDidSucceedWithCard:(const autofill::CreditCard&)card |
| 98 CVC:(const base::string16&)cvc; | 102 CVC:(const base::string16&)cvc; |
| 99 | 103 |
| 100 @end | 104 @end |
| 101 | 105 |
| 102 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_COORDINATOR_H_ | 106 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_COORDINATOR_H_ |
| OLD | NEW |