OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Public APIs to enable web applications to communicate | 6 * @fileoverview Public APIs to enable web applications to communicate |
7 * with ChromeVox. | 7 * with ChromeVox. |
8 */ | 8 */ |
9 if (typeof(goog) != 'undefined' && goog.provide) { | 9 if (typeof(goog) != 'undefined' && goog.provide) { |
10 goog.provide('cvox.Api'); | 10 goog.provide('cvox.Api'); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 * @param {Object=} properties Speech properties to use for this utterance. | 119 * @param {Object=} properties Speech properties to use for this utterance. |
120 * @private | 120 * @private |
121 */ | 121 */ |
122 function callSpeakAsync_(message, properties) { | 122 function callSpeakAsync_(message, properties) { |
123 var callback = null; | 123 var callback = null; |
124 /* Use the user supplied callback as callAsync_'s callback. */ | 124 /* Use the user supplied callback as callAsync_'s callback. */ |
125 if (properties && properties['endCallback']) { | 125 if (properties && properties['endCallback']) { |
126 callback = properties['endCallback']; | 126 callback = properties['endCallback']; |
127 } | 127 } |
128 callAsync_(message, callback); | 128 callAsync_(message, callback); |
129 }; | 129 } |
130 | 130 |
131 /** | 131 /** |
132 * Gets an object given a dotted namespace object path. | 132 * Gets an object given a dotted namespace object path. |
133 * @param {string} path | 133 * @param {string} path |
134 * @return {*} | 134 * @return {*} |
135 */ | 135 */ |
136 function getObjectByName(path) { | 136 function getObjectByName(path) { |
137 var pieces = path.split('.'); | 137 var pieces = path.split('.'); |
138 var resolved = window; | 138 var resolved = window; |
139 for (var i = 0; i < pieces.length; i++) { | 139 for (var i = 0; i < pieces.length; i++) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 /** | 254 /** |
255 * This method is kept to keep Docs from throwing an error. | 255 * This method is kept to keep Docs from throwing an error. |
256 * | 256 * |
257 */ | 257 */ |
258 cvox.Api.stop = function() { | 258 cvox.Api.stop = function() { |
259 }; | 259 }; |
260 | 260 |
261 cvox.Api.internalEnable(); | 261 cvox.Api.internalEnable(); |
262 | 262 |
263 })(); | 263 })(); |
OLD | NEW |