Bug 593187: Request for authentication for an extension install doesn't focus the correct tab. r=dtownsend, a=blocks-betaN

This commit is contained in:
Alon Zakai 2010-09-15 10:46:55 -07:00
Родитель d0526eafd0
Коммит 37ca9a1d55
2 изменённых файлов: 10 добавлений и 7 удалений

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

@ -4085,6 +4085,11 @@ function AddonInstall(aCallback, aInstallLocation, aUrl, aHash, aName, aType,
this.listeners = [];
this.existingAddon = aExistingAddon;
this.error = 0;
if (aLoadGroup)
this.window = aLoadGroup.notificationCallbacks
.getInterface(Ci.nsIDOMWindow);
else
this.window = null;
if (aUrl instanceof Ci.nsIFileURL) {
this.file = aUrl.file.QueryInterface(Ci.nsILocalFile);
@ -4968,7 +4973,7 @@ AddonInstall.prototype = {
if (iid.equals(Ci.nsIAuthPrompt2)) {
var factory = Cc["@mozilla.org/prompter;1"].
getService(Ci.nsIPromptFactory);
return factory.getPrompt(null, Ci.nsIAuthPrompt);
return factory.getPrompt(this.window, Ci.nsIAuthPrompt);
}
else if (iid.equals(Ci.nsIChannelEventSink)) {
return this;

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

@ -221,15 +221,13 @@ amManager.prototype = {
},
};
}
var window;
var window = null;
try {
// Normal approach for single-process mode
window = aMessage.target.docShell
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow).content;
window = aMessage.target.contentWindow;
} catch (e) {
// Fallback for multiprocess (e10s) mode. Appears to work but has
// not had a full suite of automated tests run on it.
// Fallback for multiprocess (e10s) mode. Should reimplement this
// properly with Window IDs when possible, see bug 596109.
window = aMessage.target.ownerDocument.defaultView;
}
return this.installAddonsFromWebpage(payload.mimetype,