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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/messages/spoken_messages.js

Issue 604423002: Use an enum for ChromeVox queue mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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/chromevox/messages/spoken_messages.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/messages/spoken_messages.js b/chrome/browser/resources/chromeos/chromevox/chromevox/messages/spoken_messages.js
index 49e2575793d649b47547e4500bc44e9056dacd26..ba2c55fb7b59d50187794ac93254ac80425a8cc7 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/messages/spoken_messages.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/messages/spoken_messages.js
@@ -30,19 +30,19 @@ cvox.SpokenMessages.messages = [];
* Speaks the message chain and interrupts any on-going speech.
*/
cvox.SpokenMessages.speakFlush = function() {
- cvox.SpokenMessages.speak(cvox.AbstractTts.QUEUE_MODE_FLUSH);
+ cvox.SpokenMessages.speak(cvox.QueueMode.FLUSH);
};
/**
* Speaks the message chain after on-going speech finishes.
*/
cvox.SpokenMessages.speakQueued = function() {
- cvox.SpokenMessages.speak(cvox.AbstractTts.QUEUE_MODE_QUEUE);
+ cvox.SpokenMessages.speak(cvox.QueueMode.QUEUE);
};
/**
* Speak the message chain.
- * @param {number} mode The speech queue mode.
+ * @param {cvox.QueueMode} mode The speech queue mode.
*/
cvox.SpokenMessages.speak = function(mode) {
for (var i = 0; i < cvox.SpokenMessages.messages.length; ++i) {
@@ -81,16 +81,16 @@ cvox.SpokenMessages.speak = function(mode) {
cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
// Always queue after the first message.
- mode = cvox.AbstractTts.QUEUE_MODE_QUEUE;
+ mode = cvox.QueueMode.QUEUE;
}
cvox.SpokenMessages.messages = [];
-}
+};
- /**
- * The newest message.
- * @return {cvox.SpokenMessage} The newest (current) message.
- */
+/**
+ * The newest message.
+ * @return {cvox.SpokenMessage} The newest (current) message.
+ */
cvox.SpokenMessages.currentMessage = function() {
if (cvox.SpokenMessages.messages.length == 0)
throw 'Invalid usage of SpokenMessages; start the chain using $m()';
@@ -102,13 +102,13 @@ cvox.SpokenMessages.currentMessage = function() {
* This will modify the way the message gets read.
* For example, if the count is 2, the message becomes pluralized according
* to our i18n resources. The message "2 links" is a possible output.
- * @param {Number} count Quantifies current message.
+ * @param {number} count Quantifies current message.
* @return {Object} This object, useful for chaining.
*/
cvox.SpokenMessages.withCount = function(count) {
cvox.SpokenMessages.currentMessage().count = count;
return cvox.SpokenMessages;
-}
+};
/**
* Quantifies the current message.
@@ -123,7 +123,7 @@ cvox.SpokenMessages.andIndexTotal = function(index, total) {
newMessage.raw = cvox.ChromeVox.msgs.getMsg('index_total', [index, total]);
cvox.SpokenMessages.messages.push(newMessage);
return cvox.SpokenMessages;
-}
+};
/**
* Ends a message. with an appropriate marker.
@@ -156,7 +156,7 @@ cvox.SpokenMessages.andRawMessage = function(message) {
newMessage.raw = message;
cvox.SpokenMessages.messages.push(newMessage);
return cvox.SpokenMessages;
-}
+};
/**
* Pauses after the message, with an appropriate marker.
@@ -166,4 +166,9 @@ cvox.SpokenMessages.andPause = function() {
return cvox.SpokenMessages.andMessage('pause');
};
+/**
+ * Adds a message.
+ * @param {string|Array} messageId The id of the message.
+ * @return {Object} This object, useful for chaining.
+ */
cvox.$m = cvox.SpokenMessages.andMessage;

Powered by Google App Engine
This is Rietveld 408576698