bug 476897 - add pref to disable caret browsing/f7 - r=gavin
authorTaras Glek <tglek@mozilla.com>
Tue, 10 Feb 2009 15:10:07 -0800
changeset 24893 2accea7cd21db54ae8d9698fb9df0d6df890299b
parent 24892 db65e0a217efdb5d0efcb427649fe2fd0bf9b920
child 24894 f2b5f8ff36d4c278215025c3da434be6e30d5ed4
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs476897
milestone1.9.2a1pre
bug 476897 - add pref to disable caret browsing/f7 - r=gavin
modules/libpref/src/init/all.js
toolkit/content/widgets/browser.xml
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -149,16 +149,18 @@ pref("gfx.color_management.mode", 2);
 pref("gfx.color_management.display_profile", "");
 pref("gfx.color_management.rendering_intent", 0);
 
 pref("gfx.downloadable_fonts.enabled", true);
 
 pref("accessibility.browsewithcaret", false);
 pref("accessibility.warn_on_browsewithcaret", true);
 
+pref("accessibility.browserwithcaret_shortcut.enabled", true);
+
 #ifndef XP_MACOSX
 // Tab focus model bit field:
 // 1 focuses text controls, 2 focuses other form elements, 4 adds links.
 // Most users will want 1, 3, or 7.
 // On OS X, we use Full Keyboard Access system preference,
 // unless accessibility.tabfocus is set by the user.
 pref("accessibility.tabfocus", 7);
 pref("accessibility.tabfocus_applies_to_xul", false);
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -997,16 +997,20 @@
     </implementation>
 
     <handlers>
       <handler event="keypress" keycode="VK_F7" group="system">
         <![CDATA[
           if (event.getPreventDefault() || !event.isTrusted)
             return;
 
+          var isEnabled = this.mPrefs.getBoolPref("accessibility.browsewithcaret_shortcut.enabled");
+          if (!isEnabled)
+            return;
+
           // Toggle browse with caret mode
           var browseWithCaretOn = false;
           var warn = true;
 
           try {
             warn = this.mPrefs.getBoolPref("accessibility.warn_on_browsewithcaret");
           } catch (ex) {
           }