Bug 1522230 - Move keyboard shortcuts button into the more options menu r=mstriemer,aswan,flod
authortrishul <trishul.goel@gmail.com>
Sat, 26 Jan 2019 08:05:32 +0000
changeset 455560 683c4fcf36be94fe0e5f2691508980919654276d
parent 455559 4a038a119dd39fcac171de346ffde7014771f8ec
child 455561 40da998f860f2d5ad59250223271f3e5057246e1
push id76855
push usermstriemer@mozilla.com
push dateSat, 26 Jan 2019 19:51:07 +0000
treeherderautoland@683c4fcf36be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstriemer, aswan, flod
bugs1522230
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1522230 - Move keyboard shortcuts button into the more options menu r=mstriemer,aswan,flod Move keyboard shortcuts button into the more options menu Differential Revision: https://phabricator.services.mozilla.com/D17542
toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xul
toolkit/mozapps/extensions/test/browser/browser_manage_shortcuts.js
--- a/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
@@ -273,18 +273,19 @@ extensions-updates-none-found =
 extensions-updates-manual-updates-found =
     .label = View Available Updates
 extensions-updates-update-selected =
     .label = Install Updates
     .tooltiptext = Install available updates in this list
 
 ## Extension shortcut management
 
-shortcuts-manage =
-  .label = Keyboard Shortcuts
+manage-extensions-shortcuts =
+    .label = Manage Extension Shortcuts
+    .accesskey = S
 shortcuts-empty-message = There are no shortcuts for this extension.
 shortcuts-no-addons = You don’t have any extensions enabled.
 shortcuts-input =
   .placeholder = Type a shortcut
 
 shortcuts-browserAction = Activate extension
 shortcuts-pageAction = Activate page action
 shortcuts-sidebarAction = Toggle the sidebar
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2488,19 +2488,16 @@ var gListView = {
           sortBy = ["uiState", "name"];
         }
         sortElements(elements, sortBy, true);
         for (let element of elements) {
           this._listBox.appendChild(element);
         }
       }
 
-      // Only show the manage shortcuts button for extensions.
-      document.getElementById("manage-shortcuts").hidden = this._type != "extension";
-
       this.filterDisabledUnsigned(showOnlyDisabledUnsigned);
       let legacyNotice = document.getElementById("legacy-extensions-notice");
       if (showLegacyInfo) {
         let el = document.getElementById("legacy-extensions-description");
         if (el.childNodes[0].nodeName == "#text") {
           el.removeChild(el.childNodes[0]);
         }
 
@@ -2517,17 +2514,16 @@ var gListView = {
       gViewController.updateCommands();
       gViewController.notifyViewChanged();
     });
   },
 
   hide() {
     gEventManager.unregisterInstallListener(this);
     doPendingUninstalls(this._listBox);
-    document.getElementById("manage-shortcuts").hidden = true;
   },
 
   filterDisabledUnsigned(aFilter = true) {
     let foundDisabledUnsigned = false;
 
     for (let item of this._listBox.childNodes) {
       if (isDisabledUnsigned(item.mAddon)) {
         foundDisabledUnsigned = true;
@@ -3546,20 +3542,16 @@ var gShortcutsView = {
     // Ensure the Extensions category is selected in case of refresh/restart.
     gCategories.select("addons://list/extension");
 
     await this.loaded;
     await this.node.contentWindow.render();
     gViewController.notifyViewChanged();
   },
 
-  refresh() {
-    return this.show();
-  },
-
   hide() {},
 
   getSelectedAddon() {
     return null;
   },
 };
 
 var gDragDrop = {
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -251,18 +251,16 @@
                        data-l10n-id="extensions-updates-installed"/>
                 <label id="updates-downloaded" hidden="true"
                        data-l10n-id="extensions-updates-downloaded"/>
                 <button id="updates-restart-btn" class="button-link" hidden="true"
                         data-l10n-id="extensions-updates-restart"
                         command="cmd_restartApp"/>
               </hbox>
 
-              <button id="manage-shortcuts" data-l10n-id="shortcuts-manage" command="cmd_showShortcuts" hidden="true"/>
-
               <button id="header-utils-btn" type="menu" data-l10n-id="tools-menu">
                 <menupopup id="utils-menu">
                   <menuitem id="utils-updateNow"
                             data-l10n-id="extensions-updates-check-for-updates"
                             command="cmd_findAllUpdates"/>
                   <menuitem id="utils-viewUpdates"
                             data-l10n-id="extensions-updates-view-updates"
                             command="cmd_goToRecentUpdates"/>
@@ -279,16 +277,20 @@
                             type="checkbox" autocheck="false"
                             command="cmd_toggleAutoUpdateDefault"/>
                   <menuitem id="utils-resetAddonUpdatesToAutomatic"
                             data-l10n-id="extensions-updates-reset-updates-to-automatic"
                             command="cmd_resetAddonAutoUpdate"/>
                   <menuitem id="utils-resetAddonUpdatesToManual"
                             data-l10n-id="extensions-updates-reset-updates-to-manual"
                             command="cmd_resetAddonAutoUpdate"/>
+                  <menuseparator/>
+                  <menuitem id="manage-shortcuts"
+                            data-l10n-id="manage-extensions-shortcuts"
+                            command="cmd_showShortcuts"/>
                 </menupopup>
               </button>
             </hbox>
           </hbox>
 
           <deck id="headered-views-content" flex="1" selectedIndex="0">
             <!-- list view -->
             <vbox id="list-view" flex="1" class="view-pane" align="stretch" tabindex="0">
--- a/toolkit/mozapps/extensions/test/browser/browser_manage_shortcuts.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_manage_shortcuts.js
@@ -45,22 +45,19 @@ add_task(async function testUpdatingComm
     let message = await extension.awaitMessage("oncommand");
     is(message, name, `Expected onCommand listener to fire with the correct name: ${name}`);
   }
 
   // Check that the original shortcuts work.
   await checkShortcut("commandOne", "4", {shiftKey: true, altKey: true});
   await checkShortcut("commandTwo", "4", {altKey: true});
 
-  // There should be a manage shortcuts link.
+  // Open the shortcuts view.
   let doc = gManagerWindow.document;
   let shortcutsLink = doc.getElementById("manage-shortcuts");
-  ok(!shortcutsLink.hidden, "The shortcuts link is visible");
-
-  // Open the shortcuts view.
   shortcutsLink.click();
   await wait_for_view_load(gManagerWindow);
 
   doc = doc.getElementById("shortcuts-view").contentDocument;
 
   let card = doc.querySelector(`.card[addon-id="${extension.id}"]`);
   ok(card, `There is a card for the extension`);