Bug 861495 - Transplant getOuterWindowWithId from nsIDOMWindowUtils to a window-related service: WebappsHandler.jsm. r=myk

This commit is contained in:
Colby Russell 2013-05-07 12:34:21 -04:00
parent f2064b7dbc
commit 3360c1ab9b

View File

@ -28,7 +28,7 @@ this.WebappsHandler = {
switch (topic) {
case "webapps-ask-install":
let chromeWin = this._getWindowByOuterId(data.oid);
let chromeWin = Services.wm.getOuterWindowById(data.oid);
if (chromeWin)
this.doInstall(data, chromeWin);
break;
@ -41,18 +41,6 @@ this.WebappsHandler = {
}
},
_getWindowByOuterId: function(outerId) {
let someWindow = Services.wm.getMostRecentWindow(null);
if (!someWindow) {
return null;
}
let content = someWindow.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIDOMWindowUtils).
getOuterWindowWithId(outerId);
return content;
},
doInstall: function(data, window) {
let {name} = data.app.manifest;
let bundle = Services.strings.createBundle("chrome://webapprt/locale/webapp.properties");