| 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_JS_PAYMENT_REQUEST_MANAGER_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ios/chrome/browser/procedural_block_types.h" | 9 #include "ios/chrome/browser/procedural_block_types.h" |
| 10 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" | 10 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
| 11 | 11 |
| 12 namespace payments { |
| 13 struct PaymentAddress; |
| 14 } |
| 15 |
| 12 namespace web { | 16 namespace web { |
| 13 class PaymentAddress; | |
| 14 class PaymentResponse; | 17 class PaymentResponse; |
| 15 class PaymentShippingOption; | 18 class PaymentShippingOption; |
| 16 } | 19 } |
| 17 | 20 |
| 18 // Injects the JavaScript that implements the Payment Request API and provides | 21 // Injects the JavaScript that implements the Payment Request API and provides |
| 19 // an app-side interface for interacting with it. | 22 // an app-side interface for interacting with it. |
| 20 @interface JSPaymentRequestManager : CRWJSInjectionManager | 23 @interface JSPaymentRequestManager : CRWJSInjectionManager |
| 21 | 24 |
| 22 // Executes a JS noop function. This is used to work around an issue where the | 25 // Executes a JS noop function. This is used to work around an issue where the |
| 23 // JS event queue is blocked while presenting the Payment Request UI. | 26 // JS event queue is blocked while presenting the Payment Request UI. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 (ProceduralBlockWithBool)completionHandler; | 48 (ProceduralBlockWithBool)completionHandler; |
| 46 | 49 |
| 47 // Resolves the JavaScript promise associated with the current PaymentResponse. | 50 // Resolves the JavaScript promise associated with the current PaymentResponse. |
| 48 // If |completionHandler| is not nil, it will be invoked with YES after the | 51 // If |completionHandler| is not nil, it will be invoked with YES after the |
| 49 // operation has completed successfully or with NO otherwise. | 52 // operation has completed successfully or with NO otherwise. |
| 50 - (void)resolveResponsePromiseWithCompletionHandler: | 53 - (void)resolveResponsePromiseWithCompletionHandler: |
| 51 (ProceduralBlockWithBool)completionHandler; | 54 (ProceduralBlockWithBool)completionHandler; |
| 52 | 55 |
| 53 // Updates the shippingAddress property on the PaymentRequest object and | 56 // Updates the shippingAddress property on the PaymentRequest object and |
| 54 // dispatches a shippingaddresschange event. | 57 // dispatches a shippingaddresschange event. |
| 55 - (void)updateShippingAddress:(const web::PaymentAddress&)shippingAddress | 58 - (void)updateShippingAddress:(const payments::PaymentAddress&)shippingAddress |
| 56 completionHandler:(ProceduralBlockWithBool)completionHanlder; | 59 completionHandler:(ProceduralBlockWithBool)completionHanlder; |
| 57 | 60 |
| 58 // Updates the shippingOption property on the PaymentRequest object and | 61 // Updates the shippingOption property on the PaymentRequest object and |
| 59 // dispatches a shippingoptionchange event. | 62 // dispatches a shippingoptionchange event. |
| 60 - (void)updateShippingOption:(const web::PaymentShippingOption&)shippingOption | 63 - (void)updateShippingOption:(const web::PaymentShippingOption&)shippingOption |
| 61 completionHandler:(ProceduralBlockWithBool)completionHanlder; | 64 completionHandler:(ProceduralBlockWithBool)completionHanlder; |
| 62 | 65 |
| 63 @end | 66 @end |
| 64 | 67 |
| 65 #endif // IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ | 68 #endif // IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
| OLD | NEW |