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

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

Issue 2694903010: AX checked state changes (Closed)
Patch Set: Remove whitespace change Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 } 1147 }
1148 } else if (token == 'parentChildCount') { 1148 } else if (token == 'parentChildCount') {
1149 if (node.parent) { 1149 if (node.parent) {
1150 options.annotation.push(token); 1150 options.annotation.push(token);
1151 var count = node.parent.children.filter(function(child) { 1151 var count = node.parent.children.filter(function(child) {
1152 return node.role == child.role; 1152 return node.role == child.role;
1153 }).length; 1153 }).length;
1154 this.append_(buff, String(count)); 1154 this.append_(buff, String(count));
1155 } 1155 }
1156 } else if (token == 'checked') { 1156 } else if (token == 'checked') {
1157 var msg; 1157 var msg = node.buttonMixed ? 'aria_checked_mixed' : (
1158 var ariaChecked = node.htmlAttributes['aria-checked']; 1158 node.state.checked ? 'aria_checked_true' : 'aria_checked_false');
1159 switch (ariaChecked) {
1160 case 'mixed':
1161 msg = 'aria_checked_mixed';
1162 break;
1163 case 'true':
1164 msg = 'aria_checked_true';
1165 break;
1166 case 'false':
1167 msg = 'aria_checked_false';
1168 break;
1169 default:
1170 msg = node.state[StateType.CHECKED] ?
1171 'aria_checked_true' : 'aria_checked_false';
1172 }
1173 this.format_(node, '@' + msg, buff); 1159 this.format_(node, '@' + msg, buff);
1174 } else if (token == 'state') { 1160 } else if (token == 'state') {
1175 if (node.state) { 1161 if (node.state) {
1176 Object.getOwnPropertyNames(node.state).forEach(function(s) { 1162 Object.getOwnPropertyNames(node.state).forEach(function(s) {
1177 var stateInfo = Output.STATE_INFO_[s]; 1163 var stateInfo = Output.STATE_INFO_[s];
1178 if (stateInfo && !stateInfo.isRoleSpecific && stateInfo.on) 1164 if (stateInfo && !stateInfo.isRoleSpecific && stateInfo.on)
1179 this.format_(node, '@' + stateInfo.on.msgId, buff); 1165 this.format_(node, '@' + stateInfo.on.msgId, buff);
1180 }.bind(this)); 1166 }.bind(this));
1181 } 1167 }
1182 } else if (token == 'find') { 1168 } else if (token == 'find') {
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 /** 1862 /**
1877 * Gets the output buffer for braille. 1863 * Gets the output buffer for braille.
1878 * @return {!Spannable} 1864 * @return {!Spannable}
1879 */ 1865 */
1880 get brailleOutputForTest() { 1866 get brailleOutputForTest() {
1881 return this.mergeBraille_(this.brailleBuffer_); 1867 return this.mergeBraille_(this.brailleBuffer_);
1882 } 1868 }
1883 }; 1869 };
1884 1870
1885 }); // goog.scope 1871 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698