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

This commit is contained in:
Colby Russell 2013-05-07 12:34:21 -04:00
Родитель 0bfb4890cd
Коммит 7dbdb26370
1 изменённых файлов: 7 добавлений и 13 удалений

Просмотреть файл

@ -87,19 +87,13 @@ this.webappsUI = {
},
_getBrowserForId: function(aId) {
let someWindow = Services.wm.getMostRecentWindow(null);
if (someWindow) {
let windowUtils = someWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let content = windowUtils.getOuterWindowWithId(aId);
if (content) {
let browser = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell).chromeEventHandler;
let win = browser.ownerDocument.defaultView;
return [win, browser];
}
let content = Services.wm.getOuterWindowWithId(aId);
if (content) {
let browser = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell).chromeEventHandler;
let win = browser.ownerDocument.defaultView;
return [win, browser];
}
return [null, null];