Bug 865447 - Expose Accessfu input object for scripting purposes. r=yzen
authorEitan Isaacson <eitan@monotonous.org>
Thu, 25 Apr 2013 09:16:10 -0700
changeset 129884 21b54ce74c1870cb16697f3986fe55657ff3ffd5
parent 129883 de487abe67a2bc8888315eb822dbd031b48f2e67
child 129885 2f3ddbc27bfacbdd51f41fa004d441b2c956652e
push id24590
push userryanvm@gmail.com
push dateFri, 26 Apr 2013 01:39:07 +0000
treeherdermozilla-central@7f68735fc8da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs865447
milestone23.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 865447 - Expose Accessfu input object for scripting purposes. r=yzen
accessible/src/jsat/AccessFu.jsm
--- a/accessible/src/jsat/AccessFu.jsm
+++ b/accessible/src/jsat/AccessFu.jsm
@@ -51,17 +51,17 @@ this.AccessFu = {
     }
 
     try {
       this._notifyOutput = this.prefsBranch.getBoolPref('notify_output');
     } catch (x) {
       this._notifyOutput = false;
     }
 
-    Input.quickNavMode.updateModes(this.prefsBranch);
+    this.Input.quickNavMode.updateModes(this.prefsBranch);
 
     this._enableOrDisable();
   },
 
   /**
    * Shut down chrome-layer accessibility functionality from the outside.
    */
   detach: function detach() {
@@ -102,17 +102,17 @@ this.AccessFu = {
 
     // Add stylesheet
     let stylesheetURL = 'chrome://global/content/accessibility/AccessFu.css';
     let stylesheet = Utils.win.document.createProcessingInstruction(
       'xml-stylesheet', 'href="' + stylesheetURL + '" type="text/css"');
     Utils.win.document.insertBefore(stylesheet, Utils.win.document.firstChild);
     this.stylesheet = Cu.getWeakReference(stylesheet);
 
-    Input.start();
+    this.Input.start();
     Output.start();
     TouchAdapter.start();
 
     Services.obs.addObserver(this, 'remote-browser-frame-shown', false);
     Services.obs.addObserver(this, 'Accessibility:NextObject', false);
     Services.obs.addObserver(this, 'Accessibility:PreviousObject', false);
     Services.obs.addObserver(this, 'Accessibility:Focus', false);
     Utils.win.addEventListener('TabOpen', this);
@@ -137,17 +137,17 @@ this.AccessFu = {
 
     Utils.win.document.removeChild(this.stylesheet.get());
 
     for each (let mm in Utils.AllMessageManagers) {
       mm.sendAsyncMessage('AccessFu:Stop');
       this._removeMessageListeners(mm);
     }
 
-    Input.stop();
+    this.Input.stop();
     Output.stop();
     TouchAdapter.stop();
 
     Utils.win.removeEventListener('TabOpen', this);
     Utils.win.removeEventListener('TabSelect', this);
 
     Services.obs.removeObserver(this, 'remote-browser-frame-shown');
     Services.obs.removeObserver(this, 'Accessibility:NextObject');
@@ -183,17 +183,17 @@ this.AccessFu = {
           mm.sendAsyncMessage('AccessFu:Start',
                               {method: 'start', buildApp: Utils.MozBuildApp});
         }
         break;
       case 'AccessFu:Present':
         this._output(aMessage.json, aMessage.target);
         break;
       case 'AccessFu:Input':
-        Input.setEditState(aMessage.json);
+        this.Input.setEditState(aMessage.json);
         break;
     }
   },
 
   _output: function _output(aPresentationData, aBrowser) {
     for each (let presenter in aPresentationData) {
       if (!presenter)
         continue;
@@ -245,37 +245,37 @@ this.AccessFu = {
 
   observe: function observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case 'Accessibility:Settings':
         this._systemPref = JSON.parse(aData).enabled;
         this._enableOrDisable();
         break;
       case 'Accessibility:NextObject':
-        Input.moveCursor('moveNext', 'Simple', 'gesture');
+        this.Input.moveCursor('moveNext', 'Simple', 'gesture');
         break;
       case 'Accessibility:PreviousObject':
-        Input.moveCursor('movePrevious', 'Simple', 'gesture');
+        this.Input.moveCursor('movePrevious', 'Simple', 'gesture');
         break;
       case 'Accessibility:Focus':
         this._focused = JSON.parse(aData);
         if (this._focused) {
           let mm = Utils.getMessageManager(Utils.CurrentBrowser);
           mm.sendAsyncMessage('AccessFu:VirtualCursor',
                               {action: 'whereIsIt', move: true});
         }
         break;
       case 'nsPref:changed':
         switch (aData) {
           case 'activate':
             this._activatePref = this.prefsBranch.getIntPref('activate');
             this._enableOrDisable();
             break;
           case 'quicknav_modes':
-            Input.quickNavMode.updateModes(this.prefsBranch);
+            this.Input.quickNavMode.updateModes(this.prefsBranch);
             break;
           case 'notify_output':
             this._notifyOutput = this.prefsBranch.getBoolPref('notify_output');
             break;
           default:
             break;
         }
         break;
@@ -708,8 +708,9 @@ var Input = {
         // Fallback
         this.modes = [];
       }
     },
 
     _currentIndex: -1
   }
 };
+AccessFu.Input = Input;