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

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

Issue 1402463005: Reuse category flush when outputing live regions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | 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 677030882eab8fc0ff4b4a6acdeaf4375eca2406..af35f3a728e32d6e4408f846ac6a3cd632f0454e 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -645,6 +645,16 @@ Output.prototype = {
},
/**
+ * Applies the given speech category to the output.
+ * @param {cvox.TtsCategory} category
+ * @return {!Output}
+ */
+ withSpeechCategory: function(category) {
+ this.speechProperties_['category'] = category;
+ return this;
+ },
+
+ /**
* Apply a format string directly to the output buffer. This lets you
* output a message directly to the buffer using the format syntax.
* @param {string} formatStr
@@ -677,7 +687,8 @@ Output.prototype = {
*/
go: function() {
// Speech.
- var queueMode = cvox.QueueMode.FLUSH;
+ var queueMode = this.speechProperties_['category'] ?
+ cvox.QueueMode.CATEGORY_FLUSH : cvox.QueueMode.FLUSH;
this.speechBuffer_.forEach(function(buff, i, a) {
if (buff.toString()) {
(function() {
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698