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 Provides output services for ChromeVox. | 6 * @fileoverview Provides output services for ChromeVox. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('Output'); | 9 goog.provide('Output'); |
10 goog.provide('Output.EventType'); | 10 goog.provide('Output.EventType'); |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 Object.getOwnPropertyNames(node.state).forEach(function(s) { | 1152 Object.getOwnPropertyNames(node.state).forEach(function(s) { |
1153 var stateInfo = Output.STATE_INFO_[s]; | 1153 var stateInfo = Output.STATE_INFO_[s]; |
1154 if (stateInfo && !stateInfo.isRoleSpecific && stateInfo.on) | 1154 if (stateInfo && !stateInfo.isRoleSpecific && stateInfo.on) |
1155 this.format_(node, '@' + stateInfo.on.msgId, buff); | 1155 this.format_(node, '@' + stateInfo.on.msgId, buff); |
1156 }.bind(this)); | 1156 }.bind(this)); |
1157 } else if (token == 'find') { | 1157 } else if (token == 'find') { |
1158 // Find takes two arguments: JSON query string and format string. | 1158 // Find takes two arguments: JSON query string and format string. |
1159 if (tree.firstChild) { | 1159 if (tree.firstChild) { |
1160 var jsonQuery = tree.firstChild.value; | 1160 var jsonQuery = tree.firstChild.value; |
1161 node = node.find( | 1161 node = node.find( |
1162 /** @type {Object}*/(JSON.parse(jsonQuery))); | 1162 /** @type {chrome.automation.FindParams}*/( |
| 1163 JSON.parse(jsonQuery))); |
1163 var formatString = tree.firstChild.nextSibling; | 1164 var formatString = tree.firstChild.nextSibling; |
1164 if (node) | 1165 if (node) |
1165 this.format_(node, formatString, buff); | 1166 this.format_(node, formatString, buff); |
1166 } | 1167 } |
1167 } else if (token == 'descendants') { | 1168 } else if (token == 'descendants') { |
1168 if (!node || AutomationPredicate.leafOrStaticText(node)) | 1169 if (!node || AutomationPredicate.leafOrStaticText(node)) |
1169 return; | 1170 return; |
1170 | 1171 |
1171 // Construct a range to the leftmost and rightmost leaves. | 1172 // Construct a range to the leftmost and rightmost leaves. |
1172 var leftmost = AutomationUtil.findNodePre( | 1173 var leftmost = AutomationUtil.findNodePre( |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1847 /** | 1848 /** |
1848 * Gets the output buffer for braille. | 1849 * Gets the output buffer for braille. |
1849 * @return {!Spannable} | 1850 * @return {!Spannable} |
1850 */ | 1851 */ |
1851 get brailleOutputForTest() { | 1852 get brailleOutputForTest() { |
1852 return this.mergeBraille_(this.brailleBuffer_); | 1853 return this.mergeBraille_(this.brailleBuffer_); |
1853 } | 1854 } |
1854 }; | 1855 }; |
1855 | 1856 |
1856 }); // goog.scope | 1857 }); // goog.scope |
OLD | NEW |