Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js

Issue 2069543004: Adjust output rules related menus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: m Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
index e16923f362cf2482b665a8e76404131908494d6a..17c7e57d8a490d9013904f8322ea1fceb80e625a 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -98,10 +98,12 @@ Output.SPACE = ' ';
* Metadata about supported automation roles.
* @const {Object<{msgId: string,
* earconId: (string|undefined),
- * inherits: (string|undefined)}>}
+ * inherits: (string|undefined),
+ * ignoreAncestry: (boolean|undefined)}>}
* msgId: the message id of the role.
* earconId: an optional earcon to play when encountering the role.
* inherits: inherits rules from this role.
+ * ignoreAncestry: don't output ancestry changes when encountering this role.
* @private
*/
Output.ROLE_INFO_ = {
@@ -223,26 +225,26 @@ Output.ROLE_INFO_ = {
inherits: 'abstractContainer'
},
menu: {
- msgId: 'role_menu',
- earconId: 'LISTBOX',
+ msgId: 'role_menu'
},
menuBar: {
msgId: 'role_menubar',
},
menuItem: {
msgId: 'role_menuitem',
- earconId: 'BUTTON'
+ ignoreAncestry: true
},
menuItemCheckBox: {
msgId: 'role_menuitemcheckbox',
- earconId: 'BUTTON'
+ ignoreAncestry: true
},
menuItemRadio: {
msgId: 'role_menuitemradio',
- earconId: 'BUTTON'
+ ignoreAncestry: true
},
menuListOption: {
- msgId: 'role_menuitem'
+ msgId: 'role_menuitem',
+ ignoreAncestry: true
},
menuListPopup: {
msgId: 'role_menu'
@@ -472,6 +474,17 @@ Output.RULES = {
'@describe_index($indexInParent, $parentChildCount) ' +
'$description'
},
+ menuItemCheckBox: {
+ speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' +
+ '$name $role $checked $description ' +
+ '@describe_index($indexInParent, $parentChildCount) '
+ },
+ menuItemRadio: {
+ speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' +
+ '$if($checked, @describe_radio_selected($name), ' +
+ '@describe_radio_unselected($name)) $description ' +
+ '@describe_index($indexInParent, $parentChildCount) '
+ },
menuListOption: {
speak: '$name @role_menuitem ' +
'@describe_index($indexInParent, $parentChildCount) $description'
@@ -485,7 +498,8 @@ Output.RULES = {
'$description'
},
radioButton: {
- speak: '$if($checked, @describe_radio_selected($name), ' +
+ speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' +
+ '$if($checked, @describe_radio_selected($name), ' +
'@describe_radio_unselected($name)) $description'
},
radioGroup: {
@@ -1320,6 +1334,11 @@ Output.prototype = {
* @private
*/
ancestry_: function(node, prevNode, type, buff) {
+ // Check to see if ancestry output is ignored.
+ if (Output.ROLE_INFO_[node.role] &&
+ Output.ROLE_INFO_[node.role].ignoreAncestry)
+ return;
+
var prevUniqueAncestors =
AutomationUtil.getUniqueAncestors(node, prevNode);
var uniqueAncestors = AutomationUtil.getUniqueAncestors(prevNode, node);
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698