| 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 30d36566f3c36b19afde6c3caf81f9beeec3c98f..2bd8a40bd468b557c559c7d7e297d5da0b986c3e 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
|
| @@ -69,10 +69,14 @@ Output = function() {
|
|
|
| /**
|
| * Current global options.
|
| - * @type {{speech: boolean, braille: boolean, auralStyle: boolean}}
|
| + * @type {{speech: boolean,
|
| + * braille: boolean,
|
| + * auralStyle: boolean,
|
| + * earcons: boolean}}
|
| * @private
|
| */
|
| - this.formatOptions_ = {speech: true, braille: false, auralStyle: false};
|
| + this.formatOptions_ =
|
| + {speech: true, braille: false, auralStyle: false, earcons: true};
|
|
|
| /**
|
| * The speech category for the generated speech utterance.
|
| @@ -437,7 +441,7 @@ Output.RULES = {
|
| },
|
| div: {
|
| enter: '$nameFromNode',
|
| - speak: '$name $description $descendants'
|
| + speak: '$name $description $descendantsNoEarcons'
|
| },
|
| grid: {
|
| enter: '$nameFromNode $role $description'
|
| @@ -714,7 +718,8 @@ Output.prototype = {
|
| * @return {!Output}
|
| */
|
| withSpeech: function(range, prevRange, type) {
|
| - this.formatOptions_ = {speech: true, braille: false, auralStyle: false};
|
| + this.formatOptions_ =
|
| + {speech: true, braille: false, auralStyle: false, earcons: true};
|
| this.render_(range, prevRange, type, this.speechBuffer_);
|
| return this;
|
| },
|
| @@ -727,7 +732,8 @@ Output.prototype = {
|
| * @return {!Output}
|
| */
|
| withRichSpeech: function(range, prevRange, type) {
|
| - this.formatOptions_ = {speech: true, braille: false, auralStyle: true};
|
| + this.formatOptions_ =
|
| + {speech: true, braille: false, auralStyle: true, earcons: true};
|
| this.render_(range, prevRange, type, this.speechBuffer_);
|
| return this;
|
| },
|
| @@ -740,7 +746,8 @@ Output.prototype = {
|
| * @return {!Output}
|
| */
|
| withBraille: function(range, prevRange, type) {
|
| - this.formatOptions_ = {speech: false, braille: true, auralStyle: false};
|
| + this.formatOptions_ =
|
| + {speech: false, braille: true, auralStyle: false, earcons: false};
|
| this.render_(range, prevRange, type, this.brailleBuffer_);
|
| return this;
|
| },
|
| @@ -753,7 +760,8 @@ Output.prototype = {
|
| * @return {!Output}
|
| */
|
| withLocation: function(range, prevRange, type) {
|
| - this.formatOptions_ = {speech: false, braille: false, auralStyle: false};
|
| + this.formatOptions_ =
|
| + {speech: false, braille: false, auralStyle: false, earcons: false};
|
| this.render_(range, prevRange, type, [] /*unused output*/);
|
| return this;
|
| },
|
| @@ -850,7 +858,8 @@ Output.prototype = {
|
| formatForSpeech: function(formatStr, opt_node) {
|
| var node = opt_node || null;
|
|
|
| - this.formatOptions_ = {speech: true, braille: false, auralStyle: false};
|
| + this.formatOptions_ =
|
| + {speech: true, braille: false, auralStyle: false, earcons: true};
|
| this.format_(node, formatStr, this.speechBuffer_);
|
|
|
| return this;
|
| @@ -867,7 +876,8 @@ Output.prototype = {
|
| formatForBraille: function(formatStr, opt_node) {
|
| var node = opt_node || null;
|
|
|
| - this.formatOptions_ = {speech: false, braille: true, auralStyle: false};
|
| + this.formatOptions_ =
|
| + {speech: false, braille: true, auralStyle: false, earcons: false};
|
| this.format_(node, formatStr, this.brailleBuffer_);
|
|
|
| return this;
|
| @@ -1124,6 +1134,11 @@ Output.prototype = {
|
| var unjoined = [];
|
| this.format_(node, '$descendants', unjoined);
|
| this.append_(buff, unjoined.join(' '), options);
|
| + } else if (token == 'descendantsNoEarcons') {
|
| + var state = this.formatOptions_.earcons;
|
| + this.formatOptions_.earcons = false;
|
| + this.format_(node, '$descendants', buff);
|
| + this.formatOptions_.earcons = state;
|
| } else if (token == 'role') {
|
| if (localStorage['useVerboseMode'] == 'false')
|
| return;
|
| @@ -1202,7 +1217,7 @@ Output.prototype = {
|
| this.format_(node, cond.nextSibling.nextSibling, buff);
|
| } else if (token == 'earcon') {
|
| // Ignore unless we're generating speech output.
|
| - if (!this.formatOptions_.speech)
|
| + if (!this.formatOptions_.speech || !this.formatOptions_.earcons)
|
| return;
|
|
|
| options.annotation.push(
|
| @@ -1655,6 +1670,8 @@ Output.prototype = {
|
| * @return {Output.Action}
|
| */
|
| findEarcon_: function(node, opt_prevNode) {
|
| + if (!this.formatOptions_.earcons)
|
| + return null;
|
| if (node === opt_prevNode)
|
| return null;
|
|
|
|
|