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

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

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 8 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
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 f19913fb28a39a92d5448ed93be4b16be93317c1..2fc65b4568b006fd38a53339eea87d99a88792d5 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -93,6 +93,9 @@ Output.ROLE_INFO_ = {
checkBox: {
msgId: 'input_type_checkbox'
},
+ date: {
+ msgId: 'input_type_date'
+ },
dialog: {
msgId: 'dialog'
},
@@ -116,6 +119,10 @@ Output.ROLE_INFO_ = {
radioButton: {
msgId: 'input_type_radio'
},
+ spinButton: {
+ msgId: 'aria_role_combobox',
+ earcon: 'LISTBOX'
+ },
textBox: {
msgId: 'input_type_text',
earcon: 'EDITABLE_TEXT'
@@ -124,6 +131,9 @@ Output.ROLE_INFO_ = {
msgId: 'input_type_text',
earcon: 'EDITABLE_TEXT'
},
+ time: {
+ msgId: 'tag_time'
+ },
toolbar: {
msgId: 'aria_role_toolbar'
}
@@ -156,7 +166,7 @@ Output.STATE_INFO_ = {
Output.RULES = {
navigate: {
'default': {
- speak: '$name $value $role',
+ speak: '$name $value $description $help $role',
braille: ''
},
alert: {
@@ -165,6 +175,10 @@ Output.RULES = {
checkBox: {
speak: '$name $role $checked'
},
+ date: {
+ enter: '$name $role',
+ leave: '@exited_container($role)'
+ },
dialog: {
enter: '$name $role'
},
@@ -207,7 +221,7 @@ Output.RULES = {
'@describe_radio_unselected($name))'
},
slider: {
- speak: '@describe_slider($value, $name)'
+ speak: '@describe_slider($value, $name) $help'
},
staticText: {
speak: '$value $name'
@@ -215,6 +229,16 @@ Output.RULES = {
tab: {
speak: '@describe_tab($name)'
},
+ textField: {
+ speak: '$name $value $if(' +
+ '$textInputType, @input_type_+$textInputType, @input_type_text) ' +
+ '$earcon(EDITABLE_TEXT)',
+ braille: ''
+ },
+ time: {
+ enter: '$name $role',
+ leave: '@exited_container($role)'
+ },
toolbar: {
enter: '$name $role'
},
@@ -303,13 +327,26 @@ Output.EventType = {
Output.prototype = {
/**
* Gets the output buffer for speech.
+ * @param {string=} opt_separator Used to join components of the output.
* @return {!cvox.Spannable}
*/
- toSpannable: function() {
+ toSpannable: function(opt_separator) {
+ opt_separator = opt_separator || '';
return this.buffer_.reduce(function(prev, cur) {
+ if (prev === null)
+ return cur;
+ prev.append(opt_separator);
prev.append(cur);
return prev;
- }, new cvox.Spannable());
+ }, null);
+ },
+
+ /**
+ * Gets the output buffer for speech with separator '|'.
+ * @return {!cvox.Spannable}
+ */
+ toSpannableForTest: function() {
+ return this.toSpannable('|');
},
/**
@@ -536,11 +573,11 @@ Output.prototype = {
this.append_(buff, text, options);
} else if (token == 'indexInParent') {
options.annotation.push(token);
- this.append_(buff, node.indexInParent + 1);
+ this.append_(buff, String(node.indexInParent + 1));
} else if (token == 'parentChildCount') {
options.annotation.push(token);
if (node.parent)
- this.append_(buff, node.parent.children.length);
+ this.append_(buff, String(node.parent.children.length));
} else if (token == 'state') {
options.annotation.push(token);
Object.getOwnPropertyNames(node.state).forEach(function(s) {

Powered by Google App Engine
This is Rietveld 408576698