| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 'url': 'input_type_url', | 399 'url': 'input_type_url', |
| 400 }; | 400 }; |
| 401 | 401 |
| 402 /** | 402 /** |
| 403 * Rules specifying format of AutomationNodes for output. | 403 * Rules specifying format of AutomationNodes for output. |
| 404 * @type {!Object<Object<Object<string>>>} | 404 * @type {!Object<Object<Object<string>>>} |
| 405 */ | 405 */ |
| 406 Output.RULES = { | 406 Output.RULES = { |
| 407 navigate: { | 407 navigate: { |
| 408 'default': { | 408 'default': { |
| 409 speak: '$name $value $role $description', | 409 speak: '$name $value $state $role $description', |
| 410 braille: '' | 410 braille: '' |
| 411 }, | 411 }, |
| 412 abstractContainer: { | 412 abstractContainer: { |
| 413 enter: '$nameFromNode $role $description', | 413 enter: '$nameFromNode $role $description', |
| 414 leave: '@exited_container($role)' | 414 leave: '@exited_container($role)' |
| 415 }, | 415 }, |
| 416 alert: { | 416 alert: { |
| 417 speak: '!doNotInterrupt $role $descendants' | 417 speak: '!doNotInterrupt $role $descendants' |
| 418 }, | 418 }, |
| 419 alertDialog: { | 419 alertDialog: { |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 if (node.parent) { | 1061 if (node.parent) { |
| 1062 options.annotation.push(token); | 1062 options.annotation.push(token); |
| 1063 var count = node.parent.children.filter(function(child) { | 1063 var count = node.parent.children.filter(function(child) { |
| 1064 return node.role == child.role; | 1064 return node.role == child.role; |
| 1065 }).length; | 1065 }).length; |
| 1066 this.append_(buff, String(count)); | 1066 this.append_(buff, String(count)); |
| 1067 } | 1067 } |
| 1068 } else if (token == 'state') { | 1068 } else if (token == 'state') { |
| 1069 options.annotation.push(token); | 1069 options.annotation.push(token); |
| 1070 Object.getOwnPropertyNames(node.state).forEach(function(s) { | 1070 Object.getOwnPropertyNames(node.state).forEach(function(s) { |
| 1071 this.append_(buff, s, options); | 1071 var stateInfo = Output.STATE_INFO_[s]; |
| 1072 if (stateInfo && stateInfo.on) |
| 1073 this.append_(buff, Msgs.getMsg(stateInfo.on.msgId), options); |
| 1072 }.bind(this)); | 1074 }.bind(this)); |
| 1073 } else if (token == 'find') { | 1075 } else if (token == 'find') { |
| 1074 // Find takes two arguments: JSON query string and format string. | 1076 // Find takes two arguments: JSON query string and format string. |
| 1075 if (tree.firstChild) { | 1077 if (tree.firstChild) { |
| 1076 var jsonQuery = tree.firstChild.value; | 1078 var jsonQuery = tree.firstChild.value; |
| 1077 node = node.find( | 1079 node = node.find( |
| 1078 /** @type {Object}*/(JSON.parse(jsonQuery))); | 1080 /** @type {Object}*/(JSON.parse(jsonQuery))); |
| 1079 var formatString = tree.firstChild.nextSibling; | 1081 var formatString = tree.firstChild.nextSibling; |
| 1080 if (node) | 1082 if (node) |
| 1081 this.format_(node, formatString, buff); | 1083 this.format_(node, formatString, buff); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 break; | 1644 break; |
| 1643 } | 1645 } |
| 1644 earconFinder = earconFinder.parent; | 1646 earconFinder = earconFinder.parent; |
| 1645 } | 1647 } |
| 1646 } | 1648 } |
| 1647 return null; | 1649 return null; |
| 1648 } | 1650 } |
| 1649 }; | 1651 }; |
| 1650 | 1652 |
| 1651 }); // goog.scope | 1653 }); // goog.scope |
| OLD | NEW |