Bug 465303 Add Preference UI for accessibility.blockautorefresh and for Hardware Acceleration. r=Neil sr=Neil
authorPhilip Chee <philip.chee@gmail.com>
Mon, 22 Nov 2010 12:02:41 +0800
changeset 6735 dec9e1fed0856b6417b32a2708a7cdf0e2ac3f90
parent 6734 747f2b20c69480902f4fc09701556b276d89785e
child 6736 7996fcc11af9d6f01f6bd5af1acadeb866641a86
push idunknown
push userunknown
push dateunknown
reviewersNeil, Neil
bugs465303
Bug 465303 Add Preference UI for accessibility.blockautorefresh and for Hardware Acceleration. r=Neil sr=Neil
suite/common/jar.mn
suite/common/pref/pref-content.js
suite/common/pref/pref-content.xul
suite/locales/en-US/chrome/common/pref/pref-content.dtd
--- a/suite/common/jar.mn
+++ b/suite/common/jar.mn
@@ -183,16 +183,17 @@ comm.jar:
 *  content/communicator/pref/pref-applications.js                   (pref/pref-applications.js)
 *  content/communicator/pref/pref-applicationManager.js             (pref/pref-applicationManager.js)
    content/communicator/pref/pref-applicationManager.xul            (pref/pref-applicationManager.xul)
    content/communicator/pref/overrideHandler.js                     (pref/overrideHandler.js)
    content/communicator/pref/pref-cache.js                          (pref/pref-cache.js)
    content/communicator/pref/pref-cache.xul                         (pref/pref-cache.xul)
    content/communicator/pref/pref-colors.js                         (pref/pref-colors.js)
    content/communicator/pref/pref-colors.xul                        (pref/pref-colors.xul)
+   content/communicator/pref/pref-content.js                        (pref/pref-content.js)
    content/communicator/pref/pref-content.xul                       (pref/pref-content.xul)
    content/communicator/pref/pref-cookies.js                        (pref/pref-cookies.js)
    content/communicator/pref/pref-cookies.xul                       (pref/pref-cookies.xul)
    content/communicator/pref/pref-download.js                       (pref/pref-download.js)
    content/communicator/pref/pref-download.xul                      (pref/pref-download.xul)
    content/communicator/pref/pref-fonts.js                          (pref/pref-fonts.js)
    content/communicator/pref/pref-fonts.xul                         (pref/pref-fonts.xul)
    content/communicator/pref/pref-history.js                        (pref/pref-history.js)
new file mode 100644
--- /dev/null
+++ b/suite/common/pref/pref-content.js
@@ -0,0 +1,43 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * the mozilla.org SeaMonkey project.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Philip Chee <philip.chee@gmail.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function updateHardwareAcceleration(aVal)
+{
+  if (/^Win/.test(navigator.platform)) {
+    document.getElementById("gfx.direct2d.disabled").value = aVal;
+  }
+}
--- a/suite/common/pref/pref-content.xul
+++ b/suite/common/pref/pref-content.xul
@@ -18,16 +18,17 @@
    -
    - The Initial Developer of the Original Code is
    - Netscape Communications Corporation.
    - Portions created by the Initial Developer are Copyright (C) 1998-1999
    - the Initial Developer. All Rights Reserved.
    -
    - Contributor(s):
    -   Robert Kaiser <kairo@kairo.at>
+   -   Philip Chee <philip.chee@gmail.com>
    -
    - Alternatively, the contents of this file may be used under the terms of
    - either the GNU General Public License Version 2 or later (the "GPL"), or
    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    - in which case the provisions of the GPL or the LGPL are applicable instead
    - of those above. If you wish to allow use of your version of this file only
    - under the terms of either the GPL or the LGPL, and not to allow others to
    - use your version of this file under the terms of the MPL, indicate your
@@ -40,34 +41,45 @@
 
 <!DOCTYPE overlay [
   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> %brandDTD;
   <!ENTITY % prefContentDTD SYSTEM "chrome://communicator/locale/pref/pref-content.dtd"> %prefContentDTD;
 ]>
 
 <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <prefpane id="content_pane"
-            label="&pref.content.title;">
+            label="&pref.content.title;"
+            script="chrome://communicator/content/pref/pref-content.js">
 
     <preferences id="content_preferences">
       <preference id="browser.chrome.site_icons"
                   name="browser.chrome.site_icons"
                   type="bool"/>
       <preference id="browser.chrome.favicons"
                   name="browser.chrome.favicons"
                   type="bool"/>
       <preference id="general.smoothScroll"
                   name="general.smoothScroll"
                   type="bool"/>
+      <preference id="gfx.direct2d.disabled"
+                  name="gfx.direct2d.disabled"
+                  type="bool" inverted="true"/>
+      <preference id="layers.accelerate-none"
+                  name="layers.accelerate-none"
+                  type="bool" inverted="true"
+                  onchange="updateHardwareAcceleration(this.value);"/>
       <preference id="browser.enable_automatic_image_resizing"
                   name="browser.enable_automatic_image_resizing"
                   type="bool"/>
       <preference id="browser.zoom.full"
                   name="browser.zoom.full"
                   type="bool" inverted="true"/>
+      <preference id="accessibility.blockautorefresh"
+                  name="accessibility.blockautorefresh"
+                  type="bool"/>
     </preferences>
 
     <description>&pref.content.description;</description>
 
     <groupbox id="siteIconPreferences" align="start">
       <caption label="&siteIcons.label;"/>
 
       <checkbox id="useSiteIcons"
@@ -82,20 +94,28 @@
 
     <separator class="thin"/>
 
     <vbox class="box-padded" align="start">
       <checkbox id="useSmoothScroll"
                 label="&useSmoothScroll.label;"
                 accesskey="&useSmoothScroll.accesskey;"
                 preference="general.smoothScroll"/>
+      <checkbox id="allowHWAccel"
+                label="&allowHWAccel.label;"
+                accesskey="&allowHWAccel.accesskey;"
+                preference="layers.accelerate-none"/>
       <checkbox id="enableAutomaticImageResizing"
                 label="&enableAutomaticImageResizing.label;"
                 accesskey="&enableAutomaticImageResizing.accesskey;"
                 preference="browser.enable_automatic_image_resizing"/>
       <checkbox id="textZoomOnly"
                 label="&textZoomOnly.label;"
                 accesskey="&textZoomOnly.accesskey;"
                 preference="browser.zoom.full"/>
+      <checkbox id="blockAutoRefresh"
+                label="&blockAutoRefresh.label;"
+                accesskey="&blockAutoRefresh.accesskey;"
+                preference="accessibility.blockautorefresh"/>
     </vbox>
 
   </prefpane>
 </overlay>
--- a/suite/locales/en-US/chrome/common/pref/pref-content.dtd
+++ b/suite/locales/en-US/chrome/common/pref/pref-content.dtd
@@ -6,10 +6,14 @@
 <!ENTITY useSiteIcons.label                     "Show website icons">
 <!ENTITY useSiteIcons.accesskey                 "S">
 <!ENTITY useFavIcons.label                      "Aggressively look for website icons when the page does not define one">
 <!ENTITY useFavIcons.accesskey                  "A">
 <!ENTITY enableAutomaticImageResizing.label     "Resize large images to fit in the browser window">
 <!ENTITY enableAutomaticImageResizing.accesskey "R">
 <!ENTITY useSmoothScroll.label                  "Use smooth scrolling">
 <!ENTITY useSmoothScroll.accesskey              "U">
+<!ENTITY allowHWAccel.label                     "Use hardware acceleration when available">
+<!ENTITY allowHWAccel.accesskey                 "e">
 <!ENTITY textZoomOnly.label                     "Zoom only text instead of full pages">
 <!ENTITY textZoomOnly.accesskey                 "Z">
+<!ENTITY blockAutoRefresh.label                 "Warn me when web sites try to redirect or reload the page">
+<!ENTITY blockAutoRefresh.accesskey             "W">