Chromium Code Reviews| 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 064573dd5f732e6666badaef82d049a80d319a43..98b1c0cf367d6cf01b8e2671298afc80bd145f7b 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/host/chrome/tts_background.js |
| @@ -219,7 +219,7 @@ cvox.TtsBackground.prototype.speak = function( |
| properties = {}; |
| } |
| if (queueMode === undefined) { |
|
Peter Lundblad
2014/09/29 13:51:04
This is now redundant.
Peter Lundblad
2014/09/29 13:51:04
This is redundant now that queueMode is required.
dmazzoni
2014/09/30 22:01:20
Done.
|
| - queueMode = cvox.AbstractTts.QUEUE_MODE_QUEUE; |
| + queueMode = cvox.QueueMode.QUEUE; |
| } |
| // Chunk to improve responsiveness. Use a replace/split pattern in order to |
| @@ -241,7 +241,7 @@ cvox.TtsBackground.prototype.speak = function( |
| propertiesCopy['endCallback'] = |
| i == (splitTextString.length - 1) ? endCallback : null; |
| this.speak(splitTextString[i], queueMode, propertiesCopy); |
| - queueMode = cvox.AbstractTts.QUEUE_MODE_QUEUE; |
| + queueMode = cvox.QueueMode.QUEUE; |
| } |
| return this; |
| } |
| @@ -268,7 +268,7 @@ cvox.TtsBackground.prototype.speak = function( |
| } catch (e) { |
| } |
| } |
| - if (queueMode === cvox.AbstractTts.QUEUE_MODE_FLUSH) { |
| + if (queueMode === cvox.QueueMode.FLUSH) { |
| this.stop(); |
| } |
| return this; |
| @@ -280,9 +280,9 @@ cvox.TtsBackground.prototype.speak = function( |
| mergedProperties['voiceName'] = this.currentVoice; |
| } |
| - if (queueMode == cvox.AbstractTts.QUEUE_MODE_CATEGORY_FLUSH && |
| + if (queueMode == cvox.QueueMode.CATEGORY_FLUSH && |
| !mergedProperties['category']) { |
| - queueMode = cvox.AbstractTts.QUEUE_MODE_FLUSH; |
| + queueMode = cvox.QueueMode.FLUSH; |
| } |
| var utterance = new cvox.Utterance(textString, mergedProperties); |
| @@ -292,15 +292,15 @@ cvox.TtsBackground.prototype.speak = function( |
| /** |
| * Use the speech queue to handle the given speech request. |
| * @param {cvox.Utterance} utterance The utterance to speak. |
| - * @param {number} queueMode The queue mode. |
| + * @param {cvox.QueueMode} queueMode The queue mode. |
| * @private |
| */ |
| cvox.TtsBackground.prototype.speakUsingQueue_ = function(utterance, queueMode) { |
| // First, take care of removing the current utterance and flushing |
| // anything from the queue we need to. If we remove the current utterance, |
| // make a note that we're going to stop speech. |
| - if (queueMode == cvox.AbstractTts.QUEUE_MODE_FLUSH || |
| - queueMode == cvox.AbstractTts.QUEUE_MODE_CATEGORY_FLUSH) { |
| + if (queueMode == cvox.QueueMode.FLUSH || |
| + queueMode == cvox.QueueMode.CATEGORY_FLUSH) { |
| if (this.shouldCancel_(this.currentUtterance_, utterance, queueMode)) { |
| this.cancelUtterance_(this.currentUtterance_); |
| this.currentUtterance_ = null; |
| @@ -422,7 +422,7 @@ cvox.TtsBackground.prototype.onTtsEvent_ = function(event, utteranceId) { |
| * |
| * @param {cvox.Utterance} utteranceToCancel The utterance in question. |
| * @param {cvox.Utterance} newUtterance The new utterance we're enqueueing. |
| - * @param {number} queueMode The queue mode. |
| + * @param {cvox.QueueMode} queueMode The queue mode. |
| * @return {boolean} True if this utterance should be canceled. |
| * @private |
| */ |
| @@ -435,11 +435,11 @@ cvox.TtsBackground.prototype.shouldCancel_ = |
| return false; |
| } |
| switch (queueMode) { |
| - case cvox.AbstractTts.QUEUE_MODE_QUEUE: |
| + case cvox.QueueMode.QUEUE: |
| return false; |
| - case cvox.AbstractTts.QUEUE_MODE_FLUSH: |
| + case cvox.QueueMode.FLUSH: |
| return true; |
| - case cvox.AbstractTts.QUEUE_MODE_CATEGORY_FLUSH: |
| + case cvox.QueueMode.CATEGORY_FLUSH: |
| return (utteranceToCancel.properties['category'] == |
| newUtterance.properties['category']); |
| } |
| @@ -655,7 +655,7 @@ cvox.TtsBackground.prototype.pronouncePhonetically_ = function(text) { |
| this.clearTimeout_(); |
| var self = this; |
| this.timeoutId_ = setTimeout(function() { |
| - self.speak(text, 1); |
| + self.speak(text, cvox.QueueMode.QUEUE); |
| }, cvox.TtsBackground.PHONETIC_DELAY_MS_); |
| return true; |
| } |