Bug 484282: add cmd/ctrl+w shortcut to close main Fennec window, r=gavin
authorMark Finkle <mfinkle@mozilla.com>
Thu, 19 Mar 2009 18:20:32 -0500
changeset 65130 32f7b1800a7dacac9d0729430daa66f6e62050cd
parent 65129 7eb7487f5e7f16cf25177de4e2c8343c44c121c7
child 65131 ae7b02ce0e34ac02ec5ffb9068a6063bfece39b0
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs484282
Bug 484282: add cmd/ctrl+w shortcut to close main Fennec window, r=gavin
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.xul
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -494,16 +494,18 @@ var BrowserUI = {
       case "cmd_forward":
       case "cmd_reload":
       case "cmd_stop":
       case "cmd_search":
       case "cmd_go":
       case "cmd_openLocation":
       case "cmd_star":
       case "cmd_bookmarks":
+      case "cmd_quit":
+      case "cmd_close":
       case "cmd_menu":
       case "cmd_newTab":
       case "cmd_closeTab":
       case "cmd_actions":
       case "cmd_panel":
       case "cmd_sanitize":
       case "cmd_zoomin":
       case "cmd_zoomout":
@@ -565,16 +567,22 @@ var BrowserUI = {
         else {
           BookmarkHelper.edit(bookmarkURI);
         }
         break;
       }
       case "cmd_bookmarks":
         this.showBookmarks();
         break;
+      case "cmd_quit":
+        goQuitApplication();
+        break;
+      case "cmd_close":
+        close();
+        break;
       case "cmd_menu":
         break;
       case "cmd_newTab":
         this.newTab();
         break;
       case "cmd_closeTab":
         this.closeTab();
         break;
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -63,16 +63,17 @@
         sizemode="maximized"
 #else
         width="800"
         height="500"
 #endif
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
 
+  <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
   <script type="application/x-javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/commandUtil.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/browser-ui.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/sanitize.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/WidgetStack.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/CanvasBrowser.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/InputHandler.js"/>
@@ -96,16 +97,18 @@
     <command id="cmd_newTab" label="&newtab.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_closeTab" label="&closetab.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
 
     <!-- bookmarking -->
     <command id="cmd_star" label="&star.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_bookmarks" label="&bookmarks.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
 
     <!-- misc -->
+    <command id="cmd_close" oncommand="CommandUpdater.doCommand(this.id);"/>
+    <command id="cmd_quit" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_menu" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_fullscreen" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_actions" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_panel" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_sanitize" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_zoomin" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_zoomout" oncommand="CommandUpdater.doCommand(this.id);"/>
 
@@ -136,16 +139,18 @@
     <key id="key_reload" keycode="VK_F5" command="cmd_reload"/>
     <key id="key_focusURL" key="l" modifiers="accel" command="cmd_openLocation"/>
 
     <!-- scrolling -->
     <key id="key_pageUp" keycode="VK_UP" command="cmd_scrollPageUp" modifiers="shift"/>
     <key id="key_pageDown" keycode="VK_DOWN" command="cmd_scrollPageDown" modifiers="shift"/>
 
     <!-- misc -->
+    <key id="key_close" key="w" modifiers="accel" command="cmd_close"/>
+    <key id="key_quit" key="q" modifiers="accel" command="cmd_quit"/>
     <key id="key_menu" keycode="VK_F4" command="cmd_menu"/>
     <key id="key_fullscreen" keycode="VK_F6" command="cmd_fullscreen"/>
     <key id="key_zoomin" keycode="VK_F7" command="cmd_zoomin"/>
     <key id="key_zoomout" keycode="VK_F8" command="cmd_zoomout"/>
 
     <!-- tabs -->
     <key id="key_newTab" key="T" modifiers="accel" command="cmd_newTab"/>
     <key id="key_closeTab" key="W" modifiers="accel" command="cmd_closeTab"/>