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

Unified Diff: chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background.js

Issue 845693004: Initial implementation of continuous read for ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove e2e test. Created 5 years, 11 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/host/chrome/tts_background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background.js
index 9886e2fd17b8e188a5b81c62cebf48d6b614c82a..91b9e5e7d97bb4013e44ef1665f8a15c87072fb1 100644
--- a/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background.js
+++ b/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background.js
@@ -229,6 +229,7 @@ cvox.TtsBackground.prototype.speak = function(
if (splitTextString.length > 2) {
var startCallback = properties['startCallback'];
var endCallback = properties['endCallback'];
+ var onEvent = properties['onEvent'];
for (var i = 0; i < splitTextString.length; i++) {
var propertiesCopy = {};
for (var p in properties) {
@@ -237,6 +238,8 @@ cvox.TtsBackground.prototype.speak = function(
propertiesCopy['startCallback'] = i == 0 ? startCallback : null;
propertiesCopy['endCallback'] =
i == (splitTextString.length - 1) ? endCallback : null;
+ propertiesCopy['onEvent'] =
+ i == (splitTextString.length - 1) ? onEvent : null;
this.speak(splitTextString[i], queueMode, propertiesCopy);
queueMode = cvox.QueueMode.QUEUE;
}
@@ -345,9 +348,12 @@ cvox.TtsBackground.prototype.startSpeakingNextItemInQueue_ = function() {
this.currentUtterance_ = this.utteranceQueue_.shift();
var utteranceId = this.currentUtterance_.id;
- this.currentUtterance_.properties['onEvent'] = goog.bind(function(event) {
- this.onTtsEvent_(event, utteranceId);
- }, this);
+ this.currentUtterance_.properties['onEvent'] =
+ this.currentUtterance_.properties['onEvent'] ||
+ goog.bind(function(event) {
+ this.onTtsEvent_(event, utteranceId);
+ },
+ this);
var validatedProperties = {};
for (var i = 0; i < cvox.TtsBackground.ALLOWED_PROPERTIES_.length; i++) {

Powered by Google App Engine
This is Rietveld 408576698