OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
| 7 |
| 8 #import "ios/web/public/web_state/js/crw_js_injection_manager.h" |
| 9 |
| 10 namespace web { |
| 11 class PaymentResponse; |
| 12 } |
| 13 |
| 14 // Injects the JavaScript that implements the Payment Request API and provides |
| 15 // an app-side interface for interacting with it. |
| 16 @interface JSPaymentRequestManager : CRWJSInjectionManager |
| 17 |
| 18 // Resolves the JavaScript promise associated with the current PaymentRequest |
| 19 // with the a JSON serialization of |paymentResponse|. |completionHandler| will |
| 20 // be invoked after the operation has completed with YES if successful. |
| 21 - (void)resolveRequestPromise:(const web::PaymentResponse&)paymentResponse |
| 22 completionHandler:(void (^)(BOOL))completionHandler; |
| 23 |
| 24 // Rejects the JavaScript promise associated with the current PaymentRequest |
| 25 // with the supplied |errorMessage|. |completionHandler| will be invoked after |
| 26 // the operation has completed with YES if successful. |
| 27 - (void)rejectRequestPromise:(NSString*)errorMessage |
| 28 completionHandler:(void (^)(BOOL))completionHandler; |
| 29 |
| 30 // Resolves the JavaScript promise associated with the current PaymentResponse. |
| 31 // |completionHandler| will be invoked after the operation has completed with |
| 32 // YES if successful. |
| 33 - (void)resolveResponsePromise:(void (^)(BOOL))completionHandler; |
| 34 |
| 35 // Rejects the JavaScript promise associated with the current PaymentResponse |
| 36 // with the supplied |errorMessage|. |completionHandler| will be invoked after |
| 37 // the operation has completed with YES if successful. |
| 38 - (void)rejectResponsePromise:(NSString*)errorMessage |
| 39 completionHandler:(void (^)(BOOL))completionHandler; |
| 40 |
| 41 @end |
| 42 |
| 43 #endif // IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
OLD | NEW |