mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 392870 - Easy discoverability of Tabbed Browsing for new users. r=connor
This commit is contained in:
parent
84f07e43f0
commit
e0c45dbe56
@ -309,8 +309,7 @@ pref("browser.link.open_newwindow", 3);
|
||||
pref("browser.link.open_newwindow.restriction", 2);
|
||||
|
||||
// Tabbed browser
|
||||
pref("browser.tabs.autoHide", true);
|
||||
pref("browser.tabs.forceHide", false);
|
||||
pref("browser.tabs.autoHide", false);
|
||||
pref("browser.tabs.warnOnClose", true);
|
||||
pref("browser.tabs.warnOnOpen", true);
|
||||
pref("browser.tabs.maxOpenBeforeWarn", 15);
|
||||
|
@ -1313,7 +1313,6 @@ AutoHideTabbarPrefListener.prototype =
|
||||
catch (e) {
|
||||
}
|
||||
gBrowser.setStripVisibilityTo(aVisible);
|
||||
gPrefService.setBoolPref("browser.tabs.forceHide", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1636,8 +1635,7 @@ function BrowserOpenFileWindow()
|
||||
}
|
||||
}
|
||||
|
||||
function BrowserCloseTabOrWindow()
|
||||
{
|
||||
function BrowserCloseTabOrWindow() {
|
||||
#ifdef XP_MACOSX
|
||||
// If we're not a browser window, just close the window
|
||||
if (window.location.href != getBrowserURL()) {
|
||||
@ -1646,23 +1644,8 @@ function BrowserCloseTabOrWindow()
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gBrowser.tabContainer.childNodes.length > 1) {
|
||||
gBrowser.removeCurrentTab();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
if (gBrowser.localName == "tabbrowser" && window.toolbar.visible &&
|
||||
!gPrefService.getBoolPref("browser.tabs.autoHide")) {
|
||||
// Replace the remaining tab with a blank one and focus the address bar
|
||||
gBrowser.removeCurrentTab();
|
||||
if (gURLBar)
|
||||
setTimeout(function() { gURLBar.focus(); }, 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
closeWindow(true);
|
||||
// If the current tab is the last one, this will close the window.
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
||||
|
||||
function BrowserTryToCloseWindow()
|
||||
|
@ -1217,8 +1217,6 @@
|
||||
if (this.mStrip.collapsed)
|
||||
this.setStripVisibilityTo(true);
|
||||
|
||||
this.mPrefs.setBoolPref("browser.tabs.forceHide", false);
|
||||
|
||||
// wire up a progress listener for the new browser object.
|
||||
var position = this.mTabContainer.childNodes.length-1;
|
||||
var tabListener = this.mTabProgressListener(t, b, blank);
|
||||
@ -1404,40 +1402,31 @@
|
||||
if (aTab.localName != "tab")
|
||||
aTab = this.mCurrentTab;
|
||||
|
||||
var l = this.mTabContainer.childNodes.length;
|
||||
if (l == 1 && this.mPrefs.getBoolPref("browser.tabs.autoHide")) {
|
||||
// hide the tab bar
|
||||
this.mPrefs.setBoolPref("browser.tabs.forceHide", true);
|
||||
this.setStripVisibilityTo(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (aFireBeforeUnload) {
|
||||
var ds = this.getBrowserForTab(aTab).docShell;
|
||||
let ds = this.getBrowserForTab(aTab).docShell;
|
||||
if (ds.contentViewer && !ds.contentViewer.permitUnload())
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
// see notes in addTab
|
||||
var _delayedUpdate = function(aTabContainer) {
|
||||
aTabContainer.adjustTabstrip();
|
||||
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
|
||||
}
|
||||
setTimeout(_delayedUpdate, 0, this.mTabContainer);
|
||||
|
||||
var l = this.mTabContainer.childNodes.length;
|
||||
if (l == 1) {
|
||||
// add a new blank tab to replace the one we're about to close
|
||||
// (this ensures that the remaining tab is as good as new)
|
||||
this.addTab("about:blank");
|
||||
l++;
|
||||
closeWindow(true);
|
||||
return null;
|
||||
}
|
||||
else if (l == 2) {
|
||||
if (l == 2) {
|
||||
var autohide = this.mPrefs.getBoolPref("browser.tabs.autoHide");
|
||||
var tabStripHide = !window.toolbar.visible;
|
||||
if (autohide || tabStripHide)
|
||||
this.setStripVisibilityTo(false);
|
||||
}
|
||||
|
||||
// see notes in addTab
|
||||
var _delayedUpdate = function (aTabContainer) {
|
||||
aTabContainer.adjustTabstrip();
|
||||
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
|
||||
};
|
||||
setTimeout(_delayedUpdate, 0, this.mTabContainer);
|
||||
|
||||
// We're committed to closing the tab now.
|
||||
// Dispatch a notification.
|
||||
// We dispatch it before any teardown so that event listeners can
|
||||
@ -1479,6 +1468,9 @@
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!aTab)
|
||||
return null;
|
||||
|
||||
var browser = this.getBrowserForTab(aTab);
|
||||
var length = this.mTabs.length;
|
||||
|
||||
@ -1668,9 +1660,8 @@
|
||||
if (!this.mAddProgressListenerWasCalled) {
|
||||
this.mAddProgressListenerWasCalled = true;
|
||||
var autoHide = this.mPrefs.getBoolPref("browser.tabs.autoHide");
|
||||
var forceHide = this.mPrefs.getBoolPref("browser.tabs.forceHide");
|
||||
var tabStripHide = !window.toolbar.visible;
|
||||
if (!autoHide && !forceHide && !tabStripHide)
|
||||
if (!autoHide && !tabStripHide)
|
||||
this.setStripVisibilityTo(true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user