Index: chrome/browser/resources/chromeos/chromevox/chromevox/injected/api_implementation.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api_implementation.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api_implementation.js |
index 6f11e35af7e36dd1e73498f90e11273ea3e973e3..26b7fb4f4a894ae9492c7c1c3c3c940ad6639876 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api_implementation.js |
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/api_implementation.js |
@@ -15,8 +15,7 @@ goog.require('cvox.ScriptInstaller'); |
/** |
* @constructor |
*/ |
-cvox.ApiImplementation = function() { |
-}; |
+cvox.ApiImplementation = function() {}; |
/** |
* Inject the API into the page and set up communication with it. |
@@ -26,8 +25,8 @@ cvox.ApiImplementation.init = function(opt_onload) { |
window.addEventListener('message', cvox.ApiImplementation.portSetup, true); |
var scripts = [window.chrome.extension.getURL('chromevox/injected/api.js')]; |
- var didInstall = cvox.ScriptInstaller.installScript(scripts, |
- 'cvoxapi', opt_onload); |
+ var didInstall = |
+ cvox.ScriptInstaller.installScript(scripts, 'cvoxapi', opt_onload); |
if (!didInstall) { |
// If the API script is already installed, just re-enable it. |
window.location.href = 'javascript:cvox.Api.internalEnable();'; |
@@ -44,8 +43,7 @@ cvox.ApiImplementation.portSetup = function(event) { |
if (event.data == 'cvox.PortSetup') { |
cvox.ApiImplementation.port = event.ports[0]; |
cvox.ApiImplementation.port.onmessage = function(event) { |
- cvox.ApiImplementation.dispatchApiMessage( |
- JSON.parse(event.data)); |
+ cvox.ApiImplementation.dispatchApiMessage(JSON.parse(event.data)); |
}; |
// Stop propagation since it was our message. |
@@ -62,8 +60,10 @@ cvox.ApiImplementation.portSetup = function(event) { |
cvox.ApiImplementation.dispatchApiMessage = function(message) { |
var method; |
switch (message['cmd']) { |
- case 'speak': method = cvox.ApiImplementation.speak; break; |
- break; |
+ case 'speak': |
+ method = cvox.ApiImplementation.speak; |
+ break; |
+ break; |
} |
if (!method) { |
throw 'Unknown API call: ' + message['cmd']; |
@@ -80,10 +80,7 @@ cvox.ApiImplementation.dispatchApiMessage = function(message) { |
*/ |
function setupEndCallback_(properties, callbackId) { |
var endCallback = function() { |
- cvox.ApiImplementation.port.postMessage(JSON.stringify( |
- { |
- 'id': callbackId |
- })); |
+ cvox.ApiImplementation.port.postMessage(JSON.stringify({'id': callbackId})); |
}; |
if (properties) { |
properties['endCallback'] = endCallback; |
@@ -104,11 +101,13 @@ cvox.ApiImplementation.speak = function( |
properties = {}; |
} |
setupEndCallback_(properties, callbackId); |
- var message = {'target': 'TTS', |
- 'action': 'speak', |
- 'text': textString, |
- 'queueMode': queueMode, |
- 'properties': properties}; |
+ var message = { |
+ 'target': 'TTS', |
+ 'action': 'speak', |
+ 'text': textString, |
+ 'queueMode': queueMode, |
+ 'properties': properties |
+ }; |
cvox.ExtensionBridge.send(message); |
}; |