Bug 557642 - An option should be added to disable auto-rotation [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Mon, 12 Apr 2010 10:58:38 -0400
changeset 66127 a446ac7c375dceb61cd05b51dedc8e47fd0cba1b
parent 66126 7fa58ac246f582d06969dcb7f07ef6daefc506c4
child 66128 30a944e514479436741ad5da921cfc446b2ed139
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs557642
Bug 557642 - An option should be added to disable auto-rotation [r=vingtetun]
mobile/app/mobile.js
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.xul
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -39,16 +39,18 @@
 pref("toolkit.defaultChromeURI", "chrome://browser/content/browser.xul");
 pref("general.useragent.extra.mobile", "@APP_UA_NAME_EXTRA@/@APP_VERSION_EXTRA@ Fennec/@APP_VERSION@");
 pref("browser.chromeURL", "chrome://browser/content/");
 
 pref("browser.startup.homepage", "about:firstrun");
 
 pref("browser.tabs.warnOnClose", true);
 
+pref("toolkit.screen.lock", false);
+
 /* use custom widget for html:select */
 pref("ui.use_native_popup_windows", true);
 
 pref("javascript.options.showInConsole", false);
 pref("browser.dom.window.dump.enabled", false);
 
 /* cache prefs */
 pref("browser.cache.disk.enable", false);
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -746,16 +746,17 @@ var BrowserUI = {
       case "cmd_menu":
       case "cmd_newTab":
       case "cmd_closeTab":
       case "cmd_actions":
       case "cmd_panel":
       case "cmd_sanitize":
       case "cmd_zoomin":
       case "cmd_zoomout":
+      case "cmd_lockscreen":
         isSupported = true;
         break;
       default:
         isSupported = false;
         break;
     }
     return isSupported;
   },
@@ -851,16 +852,22 @@ var BrowserUI = {
         break;
       }
       case "cmd_zoomin":
         Browser.zoom(-1);
         break;
       case "cmd_zoomout":
         Browser.zoom(1);
         break;
+      case "cmd_lockscreen":
+      {
+        let locked = gPrefService.getBoolPref("toolkit.screen.lock");
+        gPrefService.setBoolPref("toolkit.screen.lock", !locked);
+        break;
+      }
     }
   }
 };
 
 var PageActions = {
   get _permissionManager() {
     delete this._permissionManager;
     return this._permissionManager = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager);
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -114,22 +114,25 @@
 
     <!-- bookmarking -->
     <command id="cmd_star" label="&star.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);"/>
+
+    <!-- screen/display -->
+    <command id="cmd_fullscreen" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_zoomin" observes="bcast_contentShowing" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_zoomout" observes="bcast_contentShowing" oncommand="CommandUpdater.doCommand(this.id);"/>
+    <command id="cmd_lockscreen" oncommand="CommandUpdater.doCommand(this.id);"/>
 
     <!-- scrolling -->
     <command id="cmd_scrollPageUp" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_scrollPageDown" oncommand="CommandUpdater.doCommand(this.id);"/>
 
     <!-- editing -->
     <command id="cmd_cut" label="&cut.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_copy" label="&copy.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
@@ -149,16 +152,17 @@
     <key id="key_back" keycode="VK_LEFT" command="cmd_back" modifiers="control"/>
     <key id="key_forward" keycode="VK_RIGHT" command="cmd_forward" modifiers="control"/>
     <key id="key_back2" keycode="VK_BACK" command="cmd_back"/>
     <key id="key_forward2" keycode="VK_BACK" command="cmd_forward" modifiers="shift"/>
 #ifndef MOZ_PLATFORM_MAEMO
     <key id="key_reload" keycode="VK_F5" command="cmd_reload"/>
     <key id="key_forceReload" keycode="VK_F5" modifiers="shift" command="cmd_forceReload"/>
 #else
+    <key id="key_lockscreen" key="o" modifiers="accel,shift" command="cmd_lockscreen"/>
     <!-- F5 on maemo is "home" which is a task switching key -->
 #endif
     <key id="key_reload2" key="r" modifiers="accel" command="cmd_reload"/>
     <key id="key_forceReload2" key="r" modifiers="accel,shift" command="cmd_forceReload"/>
     <key id="key_focusURL" key="l" modifiers="accel" command="cmd_openLocation"/>
 
     <!-- scrolling -->
     <key id="key_pageUp" keycode="VK_UP" modifiers="shift" command="cmd_scrollPageUp"/>