Bug 1578131 - (Multi-select tabs) Close window directly instead of removing tabs one by one when all tabs are selected and 'closeWindowWithLastTab' pref enabled. r=dao

Differential Revision: https://phabricator.services.mozilla.com/D58699
This commit is contained in:
Abdoulaye Oumar Ly
2020-01-11 00:34:03 +00:00
parent 5a4a3c0495
commit 56f05fd552

View File

@@ -3328,6 +3328,16 @@
},
removeTabs(tabs) {
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window.
if (
this.tabs.length == tabs.length &&
Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab")
) {
window.closeWindow(true, window.warnAboutClosingWindow);
return;
}
this._clearMultiSelectionLocked = true;
// Guarantee that _clearMultiSelectionLocked lock gets released.