From 435e84add2502444f0159d5388b9c87d733194c5 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Tue, 2 Oct 2018 16:24:43 +0000 Subject: [PATCH] Bug 1480529 - Changed 'Bookmark All Tabs' to 'Bookmark Tab' for single tab selections. r=Felipe I changed the toolbar context menuitem from 'Bookmark All Tabs' to 'Bookmark Selected Tabs' because it is separated from a specific tab and thus it is not clear which tab would get bookmarked if only one is selected. This seemed much clearer to me in my testing. The wording of 'Bookmark Selected Tabs' is already used elsewhere where we have 'Reload Selected Tabs', 'Close Selected Tabs', etc. Differential Revision: https://phabricator.services.mozilla.com/D7217 --HG-- extra : moz-landing-system : lando --- browser/base/content/browser-places.js | 33 ++++++++----------- browser/base/content/browser-sets.inc | 2 -- browser/base/content/browser.js | 2 -- browser/base/content/browser.xul | 26 +++++++-------- browser/base/content/tabbrowser.js | 9 ++--- .../tabs/browser_multiselect_tabs_bookmark.js | 8 ++--- .../browser_visibleTabs_bookmarkAllTabs.js | 21 +++--------- .../browser_customization_context_menus.js | 2 +- .../locales/en-US/chrome/browser/browser.dtd | 8 ++--- 9 files changed, 42 insertions(+), 69 deletions(-) diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 2659dded7269..03e5c5e503a4 100755 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -490,27 +490,21 @@ var PlacesCommandHook = { * Adds a folder with bookmarks to URIList given in param. */ bookmarkPages(URIList) { - if (URIList.length > 1) { - PlacesUIUtils.showBookmarkDialog({ action: "add", - type: "folder", - URIList, - }, window); - } - }, - - /** - * Updates disabled state for the "Bookmark All Tabs" command. - */ - updateBookmarkAllTabsCommand: - function PCH_updateBookmarkAllTabsCommand() { - // There's nothing to do in non-browser windows. - if (window.location.href != AppConstants.BROWSER_CHROME_URL) + if (!URIList.length) { return; + } - // Disable "Bookmark All Tabs" if there are less than two - // "unique current pages". - goSetCommandEnabled("Browser:BookmarkAllTabs", - this.uniqueCurrentPages.length >= 2); + let bookmarkDialogInfo = {action: "add"}; + if (URIList.length > 1) { + bookmarkDialogInfo.type = "folder"; + bookmarkDialogInfo.URIList = URIList; + } else { + bookmarkDialogInfo.type = "bookmark"; + bookmarkDialogInfo.title = URIList[0].title; + bookmarkDialogInfo.uri = URIList[0].uri; + } + + PlacesUIUtils.showBookmarkDialog(bookmarkDialogInfo, window); }, /** @@ -1569,7 +1563,6 @@ var BookmarkingUI = { return; this.updateBookmarkPageMenuItem(); - PlacesCommandHook.updateBookmarkAllTabsCommand(); this._initMobileBookmarks(document.getElementById("menu_mobileBookmarks")); }, diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc index c28ac96efe8d..4f7539458461 100644 --- a/browser/base/content/browser-sets.inc +++ b/browser/base/content/browser-sets.inc @@ -55,8 +55,6 @@ - diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 07ae9beec324..fd25c9b8f7ee 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -5706,8 +5706,6 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) { } if (showTabStripItems) { - PlacesCommandHook.updateBookmarkAllTabsCommand(); - let haveMultipleTabs = gBrowser.visibleTabs.length > 1; document.getElementById("toolbar-context-reloadAllTabs").disabled = !haveMultipleTabs; diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 485328ed6f74..ad738e6d8f3b 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -117,6 +117,15 @@ xmlns="http://www.w3.org/1999/xhtml" +