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_UI_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ | 6 #define IOS_CHROME_BROWSER_UI_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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 (ProceduralBlockWithBool)completionHandler; | 44 (ProceduralBlockWithBool)completionHandler; |
45 | 45 |
46 // Resolves the JavaScript promise returned by the call to canMakePayment on the | 46 // Resolves the JavaScript promise returned by the call to canMakePayment on the |
47 // current PaymentRequest, with the specified |value|. If |completionHandler| is | 47 // current PaymentRequest, with the specified |value|. If |completionHandler| is |
48 // not nil, it will be invoked with YES after the operation has completed | 48 // not nil, it will be invoked with YES after the operation has completed |
49 // successfully or with NO otherwise. | 49 // successfully or with NO otherwise. |
50 - (void)resolveCanMakePaymentPromiseWithValue:(bool)value | 50 - (void)resolveCanMakePaymentPromiseWithValue:(bool)value |
51 completionHandler: | 51 completionHandler: |
52 (ProceduralBlockWithBool)completionHandler; | 52 (ProceduralBlockWithBool)completionHandler; |
53 | 53 |
| 54 // Rejects the JavaScript promise returned by the call to canMakePayment on the |
| 55 // current PaymentRequest, with the supplied |errorMessage|. If |
| 56 // |completionHandler| is not nil, it will be invoked with YES after the |
| 57 // operation has completed successfully or with NO otherwise. |
| 58 - (void)rejectCanMakePaymentPromiseWithErrorMessage:(NSString*)errorMessage |
| 59 completionHandler:(ProceduralBlockWithBool) |
| 60 completionHandler; |
| 61 |
54 // Resolves the promise returned by PaymentRequest.prototype.abort. | 62 // Resolves the promise returned by PaymentRequest.prototype.abort. |
55 - (void)resolveAbortPromiseWithCompletionHandler: | 63 - (void)resolveAbortPromiseWithCompletionHandler: |
56 (ProceduralBlockWithBool)completionHandler; | 64 (ProceduralBlockWithBool)completionHandler; |
57 | 65 |
58 // Resolves the JavaScript promise associated with the current PaymentResponse. | 66 // Resolves the JavaScript promise associated with the current PaymentResponse. |
59 // If |completionHandler| is not nil, it will be invoked with YES after the | 67 // If |completionHandler| is not nil, it will be invoked with YES after the |
60 // operation has completed successfully or with NO otherwise. | 68 // operation has completed successfully or with NO otherwise. |
61 - (void)resolveResponsePromiseWithCompletionHandler: | 69 - (void)resolveResponsePromiseWithCompletionHandler: |
62 (ProceduralBlockWithBool)completionHandler; | 70 (ProceduralBlockWithBool)completionHandler; |
63 | 71 |
64 // Updates the shippingAddress property on the PaymentRequest object and | 72 // Updates the shippingAddress property on the PaymentRequest object and |
65 // dispatches a shippingaddresschange event. | 73 // dispatches a shippingaddresschange event. |
66 - (void)updateShippingAddress:(const payments::PaymentAddress&)shippingAddress | 74 - (void)updateShippingAddress:(const payments::PaymentAddress&)shippingAddress |
67 completionHandler:(ProceduralBlockWithBool)completionHanlder; | 75 completionHandler:(ProceduralBlockWithBool)completionHanlder; |
68 | 76 |
69 // Updates the shippingOption property on the PaymentRequest object and | 77 // Updates the shippingOption property on the PaymentRequest object and |
70 // dispatches a shippingoptionchange event. | 78 // dispatches a shippingoptionchange event. |
71 - (void)updateShippingOption:(const web::PaymentShippingOption&)shippingOption | 79 - (void)updateShippingOption:(const web::PaymentShippingOption&)shippingOption |
72 completionHandler:(ProceduralBlockWithBool)completionHanlder; | 80 completionHandler:(ProceduralBlockWithBool)completionHanlder; |
73 | 81 |
74 @end | 82 @end |
75 | 83 |
76 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ | 84 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_ |
OLD | NEW |