Relanding Bug 403193 - Don't show Save Password notification bar in parent window when child has history. r=gavin, a1.9=schrep

git-svn-id: svn://10.0.0.236/trunk@245343 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dolske%mozilla.com 2008-02-10 06:08:29 +00:00
parent 55135fa04c
commit 246688230f

View File

@ -566,18 +566,22 @@ LoginManagerPrompter.prototype = {
// upon submission of credentials. We want to put the notification
// bar in the opener window if this seems to be happening.
if (notifyWindow.opener) {
var chromeWin = notifyWindow
var webnav = notifyWindow
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.getInterface(Ci.nsIWebNavigation);
var chromeWin = webnav
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
var chromeDoc = chromeWin.document.documentElement;
// Check to see if the current window was opened with
// chrome disabled, and if so use the opener window.
if (chromeDoc.getAttribute("chromehidden")) {
// Check to see if the current window was opened with chrome
// disabled, and if so use the opener window. But if the window
// has been used to visit other pages (ie, has a history),
// assume it'll stick around and *don't* use the opener.
if (chromeDoc.getAttribute("chromehidden") &&
webnav.sessionHistory.count == 1) {
this.log("Using opener window for notification bar.");
notifyWindow = notifyWindow.opener;
}