Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Side by Side Diff: ios/chrome/browser/web/resources/payment_request.js

Issue 2968503002: [Payment Request] CanMakePayment (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/payments/payment_request_manager.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 5 /**
6 * @fileoverview JavaScript implementation of the Payment Request API. When 6 * @fileoverview JavaScript implementation of the Payment Request API. When
7 * loaded, installs the API onto the window object. Conforms 7 * loaded, installs the API onto the window object. Conforms
8 * to https://www.w3.org/TR/payment-request/. Note: This is a work in progress. 8 * to https://www.w3.org/TR/payment-request/. Note: This is a work in progress.
9 */ 9 */
10 10
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 __gCrWeb['paymentRequestManager'].requestPromiseResolver.resolve( 297 __gCrWeb['paymentRequestManager'].requestPromiseResolver.resolve(
298 paymentResponse); 298 paymentResponse);
299 __gCrWeb['paymentRequestManager'].requestPromiseResolver = null; 299 __gCrWeb['paymentRequestManager'].requestPromiseResolver = null;
300 __gCrWeb['paymentRequestManager'].pendingRequest = null; 300 __gCrWeb['paymentRequestManager'].pendingRequest = null;
301 __gCrWeb['paymentRequestManager'].updateEvent = null; 301 __gCrWeb['paymentRequestManager'].updateEvent = null;
302 }; 302 };
303 303
304 /** 304 /**
305 * Rejects the pending PaymentRequest. 305 * Rejects the pending PaymentRequest.
306 * @param {string} message An error message explaining why the Promise is 306 * @param {string} message An error message explaining why the Promise is
307 * being rejected. 307 * being rejected.
308 */ 308 */
309 __gCrWeb['paymentRequestManager'].rejectRequestPromise = function(message) { 309 __gCrWeb['paymentRequestManager'].rejectRequestPromise = function(message) {
310 if (!__gCrWeb['paymentRequestManager'].requestPromiseResolver) { 310 if (!__gCrWeb['paymentRequestManager'].requestPromiseResolver) {
311 throw new Error( 311 throw new Error(
312 'Internal PaymentRequest error: No Promise to reject. ', 312 'Internal PaymentRequest error: No Promise to reject. ',
313 'Message was: ', message); 313 'Message was: ', message);
314 } 314 }
315 315
316 __gCrWeb['paymentRequestManager'].requestPromiseResolver.reject(message); 316 __gCrWeb['paymentRequestManager'].requestPromiseResolver.reject(message);
317 __gCrWeb['paymentRequestManager'].requestPromiseResolver = null; 317 __gCrWeb['paymentRequestManager'].requestPromiseResolver = null;
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 } 854 }
855 855
856 var message = { 856 var message = {
857 'command': 'paymentRequest.responseComplete', 857 'command': 'paymentRequest.responseComplete',
858 'result': opt_result, 858 'result': opt_result,
859 }; 859 };
860 __gCrWeb.message.invokeOnHost(message); 860 __gCrWeb.message.invokeOnHost(message);
861 861
862 return __gCrWeb['paymentRequestManager'].responsePromiseResolver.promise; 862 return __gCrWeb['paymentRequestManager'].responsePromiseResolver.promise;
863 }; 863 };
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/payments/payment_request_manager.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698