Bug 916740 - Expose Keyboard.jsm to shell.js. r=kchen, a=koi+
authorJan Jongboom <janjongboom@gmail.com>
Tue, 17 Sep 2013 11:11:57 -0400
changeset 160462 2c4b019897b6cd0515ebb10b1be151315ac39afd
parent 160461 ad676365b814cbabe3353163687fe41034b22f67
child 160463 8e61e0ea0c30ceeeee4dff2cc36985bcd990c532
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskchen, koi
bugs916740
milestone26.0a2
Bug 916740 - Expose Keyboard.jsm to shell.js. r=kchen, a=koi+
b2g/chrome/content/shell.js
b2g/components/Keyboard.jsm
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -1072,20 +1072,18 @@ let RemoteDebugger = {
       DebuggerServer.closeListener();
     } catch (e) {
       dump('Unable to stop debugger server: ' + e + '\n');
     }
   }
 }
 
 let KeyboardHelper = {
-  handleEvent: function keyboard_handleEvent(aMessage) {
-    let data = aMessage.data;
-
-    Keyboard.setLayouts(data.layouts);
+  handleEvent: function keyboard_handleEvent(detail) {
+    Keyboard.setLayouts(detail.layouts);
   }
 };
 
 // This is the backend for Gaia's screenshot feature.  Gaia requests a
 // screenshot by sending a mozContentEvent with detail.type set to
 // 'take-screenshot'.  Then we take a screenshot and send a
 // mozChromeEvent with detail.type set to 'take-screenshot-success'
 // and detail.file set to the an image/png blob
--- a/b2g/components/Keyboard.jsm
+++ b/b2g/components/Keyboard.jsm
@@ -12,17 +12,17 @@ const Ci = Components.interfaces;
 const kFormsFrameScript = 'chrome://browser/content/forms.js';
 
 Cu.import('resource://gre/modules/Services.jsm');
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
   "@mozilla.org/parentprocessmessagemanager;1", "nsIMessageBroadcaster");
 
-let Keyboard = {
+this.Keyboard = {
   _messageManager: null,
   _messageNames: [
     'SetValue', 'RemoveFocus', 'SetSelectedOption', 'SetSelectedOptions',
     'SetSelectionRange', 'ReplaceSurroundingText', 'ShowInputMethodPicker',
     'SwitchToNextInputMethod', 'HideInputMethod',
     'GetText', 'SendKey', 'GetContext',
     'SetComposition', 'EndComposition'
   ],
@@ -266,9 +266,9 @@ let Keyboard = {
     // cache the layouts so on init we can respond immediately instead
     // of going back and forth between keyboard_manager
     this._layouts = layouts;
 
     ppmm.broadcastAsyncMessage('Keyboard:LayoutsChange', layouts);
   }
 };
 
-Keyboard.init();
+this.Keyboard.init();