Bug 982969 - DIALOG_CLOSED_BY_USER fires oncancel. r=jedp

This commit is contained in:
Sam Penrose 2014-05-13 13:56:30 -07:00
parent 2ade14869b
commit 46179ab350
3 changed files with 16 additions and 7 deletions

View File

@ -71,13 +71,18 @@ this.FxAccountsMgmtService = {
handleEvent: function(aEvent) {
let msg = aEvent.detail;
log.debug("Got content msg " + JSON.stringify(msg));
log.debug("MgmtService got content event: " + JSON.stringify(msg));
let self = FxAccountsMgmtService;
if (!msg.id) {
return;
}
if (msg.error) {
self._onReject(msg.id, msg.error);
return;
}
let data = msg.data;
if (!data) {
return;

View File

@ -38,7 +38,7 @@ FxAccountsUIGlue.prototype = {
return;
}
log.debug("Got content event " + JSON.stringify(msg));
log.debug("UIGlue got content event " + JSON.stringify(msg));
if (msg.error) {
deferred.reject(msg);

View File

@ -151,6 +151,10 @@ FxAccountsService.prototype = {
},
error => {
log.error("get assertion failed: " + JSON.stringify(error));
// Cancellation is passed through an error channel; here we reroute.
if (error.details && (error.details.error == "DIALOG_CLOSED_BY_USER")) {
return this.doCancel(aRPId);
}
this.doError(aRPId, error);
}
);
@ -198,7 +202,7 @@ FxAccountsService.prototype = {
doLogin: function doLogin(aRpCallerId, aAssertion) {
let rp = this._rpFlows.get(aRpCallerId);
if (!rp) {
log.warn("doLogin found no rp to go with callerId " + aRpCallerId + "\n");
log.warn("doLogin found no rp to go with callerId " + aRpCallerId);
return;
}
@ -208,7 +212,7 @@ FxAccountsService.prototype = {
doLogout: function doLogout(aRpCallerId) {
let rp = this._rpFlows.get(aRpCallerId);
if (!rp) {
log.warn("doLogout found no rp to go with callerId " + aRpCallerId + "\n");
log.warn("doLogout found no rp to go with callerId " + aRpCallerId);
return;
}
@ -218,7 +222,7 @@ FxAccountsService.prototype = {
doReady: function doReady(aRpCallerId) {
let rp = this._rpFlows.get(aRpCallerId);
if (!rp) {
log.warn("doReady found no rp to go with callerId " + aRpCallerId + "\n");
log.warn("doReady found no rp to go with callerId " + aRpCallerId);
return;
}
@ -228,7 +232,7 @@ FxAccountsService.prototype = {
doCancel: function doCancel(aRpCallerId) {
let rp = this._rpFlows.get(aRpCallerId);
if (!rp) {
log.warn("doCancel found no rp to go with callerId " + aRpCallerId + "\n");
log.warn("doCancel found no rp to go with callerId " + aRpCallerId);
return;
}
@ -238,7 +242,7 @@ FxAccountsService.prototype = {
doError: function doError(aRpCallerId, aError) {
let rp = this._rpFlows.get(aRpCallerId);
if (!rp) {
log.warn("doCancel found no rp to go with callerId " + aRpCallerId + "\n");
log.warn("doError found no rp to go with callerId " + aRpCallerId);
return;
}