Disable new location bar (bug 366797) again due to Ts/Txul regression

This commit is contained in:
gavin@gavinsharp.com 2007-07-03 15:32:31 -07:00
Родитель f8eb726afe
Коммит 7ab79d699a
2 изменённых файлов: 56 добавлений и 4 удалений

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

@ -2,10 +2,12 @@ searchbar {
-moz-binding: url("chrome://browser/content/search/search.xml#searchbar");
}
/* ::::: location bar ::::: */
/* XXX Disabled for now due to perf/leak regressions
/ ::::: location bar ::::: /
#urlbar {
-moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
}
*/
#PopupAutoComplete {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-result-popup");

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

@ -101,6 +101,7 @@ var gNavigatorBundle = null;
var gIsLoadingBlank = false;
var gLastValidURLStr = "";
var gLastValidURL = null;
var gClickSelectsAll = false;
var gMustLoadSidebar = false;
var gProgressMeterPanel = null;
var gProgressCollapseTimer = null;
@ -116,6 +117,7 @@ var gChromeState = null; // chrome state before we went into print preview
var gSanitizeListener = null;
var gURLBarAutoFillPrefListener = null;
var gAutoHideTabbarPrefListener = null;
var gBookmarkAllTabsHandler = null;
@ -1074,6 +1076,11 @@ function delayedStartup()
// Set up Sanitize Item
gSanitizeListener = new SanitizeListener();
// Enable/Disable URL Bar Auto Fill
gURLBarAutoFillPrefListener = new URLBarAutoFillPrefListener();
gPrefService.addObserver(gURLBarAutoFillPrefListener.domain,
gURLBarAutoFillPrefListener, false);
// Enable/Disable auto-hide tabbar
gAutoHideTabbarPrefListener = new AutoHideTabbarPrefListener();
gPrefService.addObserver(gAutoHideTabbarPrefListener.domain,
@ -1082,6 +1089,10 @@ function delayedStartup()
gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton, false);
gHomeButton.updateTooltip();
gClickSelectsAll = gPrefService.getBoolPref("browser.urlbar.clickSelectsAll");
if (gURLBar)
gURLBar.clickSelectsAll = gClickSelectsAll;
#ifdef HAVE_SHELL_SERVICE
// Perform default browser checking (after window opens).
var shell = getShellService();
@ -1210,6 +1221,8 @@ function BrowserShutdown()
#endif
try {
gPrefService.removeObserver(gURLBarAutoFillPrefListener.domain,
gURLBarAutoFillPrefListener);
gPrefService.removeObserver(gAutoHideTabbarPrefListener.domain,
gAutoHideTabbarPrefListener);
gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
@ -1315,6 +1328,41 @@ function nonBrowserWindowDelayedStartup()
}
#endif
function URLBarAutoFillPrefListener()
{
this.toggleAutoFillInURLBar();
}
URLBarAutoFillPrefListener.prototype =
{
domain: "browser.urlbar.autoFill",
observe: function (aSubject, aTopic, aPrefName)
{
if (aTopic != "nsPref:changed" || aPrefName != this.domain)
return;
this.toggleAutoFillInURLBar();
},
toggleAutoFillInURLBar: function ()
{
if (!gURLBar)
return;
var prefValue = false;
try {
prefValue = gPrefService.getBoolPref(this.domain);
}
catch (e) {
}
if (prefValue)
gURLBar.setAttribute("completedefaultindex", "true");
else
gURLBar.removeAttribute("completedefaultindex");
}
}
function AutoHideTabbarPrefListener()
{
this.toggleAutoHideTabbar();
@ -3309,6 +3357,8 @@ function BrowserToolboxCustomizeDone(aToolboxChanged)
// Update global UI elements that may have been added or removed
if (aToolboxChanged) {
gURLBar = document.getElementById("urlbar");
if (gURLBar)
gURLBar.clickSelectsAll = gClickSelectsAll;
gProxyButton = document.getElementById("page-proxy-button");
gProxyFavIcon = document.getElementById("page-proxy-favicon");
gProxyDeck = document.getElementById("page-proxy-deck");