From 0873d26649d6c7d8a1d217c471b3adc900c3819e Mon Sep 17 00:00:00 2001 From: Brian Nicholson Date: Mon, 4 Feb 2013 13:22:30 -0800 Subject: [PATCH] Bug 837848 - Remove gecko property from handleGeckoMessage calls. r=mfinkle --- accessible/src/jsat/AccessFu.jsm | 6 +++--- mobile/android/chrome/content/about.xhtml | 6 +----- mobile/android/components/NSSDialogService.js | 2 +- .../android/modules/LightweightThemeConsumer.jsm | 4 ++-- testing/mochitest/roboextender/bootstrap.js | 10 ++++------ toolkit/content/aboutSupport.js | 16 ++++++---------- 6 files changed, 17 insertions(+), 27 deletions(-) diff --git a/accessible/src/jsat/AccessFu.jsm b/accessible/src/jsat/AccessFu.jsm index 69df693ea7ef..ca0a3676f55f 100644 --- a/accessible/src/jsat/AccessFu.jsm +++ b/accessible/src/jsat/AccessFu.jsm @@ -39,7 +39,7 @@ this.AccessFu = { try { Cc['@mozilla.org/android/bridge;1']. getService(Ci.nsIAndroidBridge).handleGeckoMessage( - JSON.stringify({ gecko: { type: 'Accessibility:Ready' } })); + JSON.stringify({ type: 'Accessibility:Ready' })); Services.obs.addObserver(this, 'Accessibility:Settings', false); } catch (x) { // Not on Android @@ -348,7 +348,7 @@ var Output = { androidEvent.type = 'Accessibility:Event'; if (androidEvent.bounds) androidEvent.bounds = this._adjustBounds(androidEvent.bounds, aBrowser); - this._bridge.handleGeckoMessage(JSON.stringify({gecko: androidEvent})); + this._bridge.handleGeckoMessage(JSON.stringify(androidEvent)); } }, @@ -508,7 +508,7 @@ var Input = { // Return focus to native Android browser chrome. Cc['@mozilla.org/android/bridge;1']. getService(Ci.nsIAndroidBridge).handleGeckoMessage( - JSON.stringify({ gecko: { type: 'ToggleChrome:Focus' } })); + JSON.stringify({ type: 'ToggleChrome:Focus' })); break; case aEvent.DOM_VK_RETURN: case aEvent.DOM_VK_ENTER: diff --git a/mobile/android/chrome/content/about.xhtml b/mobile/android/chrome/content/about.xhtml index 3122ccf07f9e..fb7513f807d7 100644 --- a/mobile/android/chrome/content/about.xhtml +++ b/mobile/android/chrome/content/about.xhtml @@ -125,11 +125,7 @@ showCheckingMessage(); let bridge = Cc["@mozilla.org/android/bridge;1"].getService(Ci.nsIAndroidBridge); - bridge.handleGeckoMessage(JSON.stringify({ - gecko: { - type: "Update:Check", - } - })); + bridge.handleGeckoMessage(JSON.stringify({ type: "Update:Check" })); } let updateLink = document.getElementById("updateLink"); diff --git a/mobile/android/components/NSSDialogService.js b/mobile/android/components/NSSDialogService.js index e3179d67b0c6..b67322afcf39 100644 --- a/mobile/android/components/NSSDialogService.js +++ b/mobile/android/components/NSSDialogService.js @@ -38,7 +38,7 @@ NSSDialogs.prototype = { buttons: aButtons, inputs: aInputs }; - let data = Cc["@mozilla.org/android/bridge;1"].getService(Ci.nsIAndroidBridge).handleGeckoMessage(JSON.stringify({ gecko: msg })); + let data = Cc["@mozilla.org/android/bridge;1"].getService(Ci.nsIAndroidBridge).handleGeckoMessage(JSON.stringify(msg)); return JSON.parse(data); }, diff --git a/mobile/android/modules/LightweightThemeConsumer.jsm b/mobile/android/modules/LightweightThemeConsumer.jsm index f984f605c069..33cf52456fff 100644 --- a/mobile/android/modules/LightweightThemeConsumer.jsm +++ b/mobile/android/modules/LightweightThemeConsumer.jsm @@ -37,8 +37,8 @@ LightweightThemeConsumer.prototype = { let active = !!aData.headerURL; - let msg = active ? { gecko: { type: "LightweightTheme:Update", data: aData } } : - { gecko: { type: "LightweightTheme:Disable" } }; + let msg = active ? { type: "LightweightTheme:Update", data: aData } : + { type: "LightweightTheme:Disable" }; let bridge = Cc["@mozilla.org/android/bridge;1"].getService(Ci.nsIAndroidBridge); bridge.handleGeckoMessage(JSON.stringify(msg)); } diff --git a/testing/mochitest/roboextender/bootstrap.js b/testing/mochitest/roboextender/bootstrap.js index ce6a3acbefef..b8bd693bf61d 100644 --- a/testing/mochitest/roboextender/bootstrap.js +++ b/testing/mochitest/roboextender/bootstrap.js @@ -22,12 +22,10 @@ var windowListener = { if (domWindow) { domWindow.addEventListener("scroll", function(e) { let message = { - gecko: { - type: 'robocop:scroll', - y: XPCNativeWrapper.unwrap(e.target).documentElement.scrollTop, - height: XPCNativeWrapper.unwrap(e.target).documentElement.scrollHeight, - cheight: XPCNativeWrapper.unwrap(e.target).documentElement.clientHeight, - } + type: 'robocop:scroll', + y: XPCNativeWrapper.unwrap(e.target).documentElement.scrollTop, + height: XPCNativeWrapper.unwrap(e.target).documentElement.scrollHeight, + cheight: XPCNativeWrapper.unwrap(e.target).documentElement.clientHeight, }; let retVal = _sendMessageToJava(message); }); diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index d61985a5aa95..f26933d297e6 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -242,11 +242,9 @@ function copyRawDataToClipboard(button) { #ifdef ANDROID // Present a toast notification. let message = { - gecko: { - type: "Toast:Show", - message: stringBundle().GetStringFromName("rawDataCopied"), - duration: "short" - } + type: "Toast:Show", + message: stringBundle().GetStringFromName("rawDataCopied"), + duration: "short" }; Cc["@mozilla.org/android/bridge;1"]. getService(Ci.nsIAndroidBridge). @@ -300,11 +298,9 @@ function copyContentsToClipboard() { #ifdef ANDROID // Present a toast notification. let message = { - gecko: { - type: "Toast:Show", - message: stringBundle().GetStringFromName("textCopied"), - duration: "short" - } + type: "Toast:Show", + message: stringBundle().GetStringFromName("textCopied"), + duration: "short" }; Cc["@mozilla.org/android/bridge;1"]. getService(Ci.nsIAndroidBridge).