Bug 855273 - Clean up how we determine whether the location should be displayed for new tabs (customizing browser.newtab.url hides the URL for new tabs, displays it when de- and re-selecting the tab). r=ttaubert

--HG--
extra : rebase_source : 030a76811975cceece7bb4dc9553d90331a107e3
This commit is contained in:
Dão Gottwald 2013-03-27 16:32:07 +01:00
parent f1ee8cb7cb
commit 7e3236eb6a

View File

@ -1268,10 +1268,9 @@
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"tab");
var uriIsBlankPage = !aURI || isBlankPageURL(aURI);
var uriIsNotAboutBlank = aURI && aURI != "about:blank";
var uriIsAboutBlank = !aURI || aURI == "about:blank";
if (uriIsBlankPage)
if (!aURI || isBlankPageURL(aURI))
t.setAttribute("label", this.mStringBundle.getString("tabs.emptyTabTitle"));
else
t.setAttribute("label", aURI);
@ -1375,7 +1374,7 @@
this.tabContainer.updateVisibility();
if (uriIsNotAboutBlank) {
if (!uriIsAboutBlank) {
// Stop the existing about:blank load. Otherwise, if aURI
// doesn't stop in-progress loads on its own, we'll get into
// trouble with multiple parallel loads running at once.
@ -1383,7 +1382,7 @@
}
// wire up a progress listener for the new browser object.
var tabListener = this.mTabProgressListener(t, b, uriIsBlankPage);
var tabListener = this.mTabProgressListener(t, b, uriIsAboutBlank);
const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(Components.interfaces.nsIWebProgress);
filter.addProgressListener(tabListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
@ -1405,10 +1404,10 @@
evt.initEvent("TabOpen", true, false);
t.dispatchEvent(evt);
if (uriIsNotAboutBlank) {
if (!uriIsAboutBlank) {
// pretend the user typed this so it'll be available till
// the document successfully loads
if (!uriIsBlankPage)
if (aURI && gInitialPages.indexOf(aURI) == -1)
b.userTypedValue = aURI;
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;