Bug 832951 - [WebPayment] Expose DOMRequest ID within mozChromeEvents. r=fabrice, a=tef+
authorFernando Jiménez <ferjmoreno@gmail.com>
Tue, 22 Jan 2013 12:29:54 +0100
changeset 118288 dda716701b9db1b3b4d3057b979b5439a2b021dc
parent 118287 1ea93193e006fac3a84bfd06a5dc250effc5da8c
child 118289 c3dd2edbf5014e7f0883ab838e2be92fe37e4bbc
push id331
push userryanvm@gmail.com
push dateThu, 24 Jan 2013 00:20:48 +0000
reviewersfabrice, tef
bugs832951
milestone18.0
Bug 832951 - [WebPayment] Expose DOMRequest ID within mozChromeEvents. r=fabrice, a=tef+
b2g/chrome/content/payment.js
b2g/components/PaymentGlue.js
--- a/b2g/chrome/content/payment.js
+++ b/b2g/chrome/content/payment.js
@@ -56,17 +56,18 @@ function closePaymentFlowDialog(aCallbac
   let browser = Services.wm.getMostRecentWindow("navigator:browser");
   let content = browser.getContentWindow();
   if (!content) {
     return;
   }
 
   let detail = {
     type: kClosePaymentFlowEvent,
-    id: id
+    id: id,
+    requestId: requestId
   };
 
   // In order to avoid race conditions, we wait for the UI to notify that
   // it has successfully closed the payment flow and has recovered the
   // caller app, before notifying the parent process to fire the success
   // or error event over the DOMRequest.
   content.addEventListener("mozContentEvent",
                            function closePaymentFlowReturn(evt) {
--- a/b2g/components/PaymentGlue.js
+++ b/b2g/components/PaymentGlue.js
@@ -49,16 +49,17 @@ PaymentUI.prototype = {
 
     // The UI should listen for mozChromeEvent 'open-payment-confirmation-dialog'
     // type in order to create and show the payment request confirmation frame
     // embeded within a trusted dialog.
     let id = kOpenPaymentConfirmationEvent + "-" + this.getRandomId();
     let detail = {
       type: kOpenPaymentConfirmationEvent,
       id: id,
+      requestId: aRequestId,
       paymentRequests: aRequests
     };
 
     // Once the user confirm the payment request and makes his choice, we get
     // back to the DOM part to get the appropriate payment flow information
     // based on the selected payment provider.
     content.addEventListener("mozContentEvent", function handleSelection(evt) {
       let msg = evt.detail;
@@ -94,16 +95,17 @@ PaymentUI.prototype = {
       _error("NO_CONTENT_WINDOW");
       return;
     }
 
     let id = kOpenPaymentFlowEvent + "-" + this.getRandomId();
     let detail = {
       type: kOpenPaymentFlowEvent,
       id: id,
+      requestId: aRequestId,
       uri: aPaymentFlowInfo.uri,
       method: aPaymentFlowInfo.requestMethod,
       jwt: aPaymentFlowInfo.jwt
     };
 
     // At some point the UI would send the created iframe back so the
     // callbacks for firing DOMRequest events can be loaded on its
     // content.