Index: chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js |
index 922f558274d64430bf0bbfd6d10f1e8edbf2a005..8235a27d72cef1913fc438f9d95231ce85423a41 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js |
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js |
@@ -1325,19 +1325,18 @@ cvox.ChromeVoxEventWatcher.handleDialogFocus = function(target) { |
cvox.ChromeVox.navigationManager.currentDialog)) { |
cvox.ChromeVox.navigationManager.currentDialog = null; |
- cvox.ChromeVox.tts.speak( |
+ cvox.ChromeVoxEventWatcher.speakAnnotationWithCategory_( |
cvox.ChromeVox.msgs.getMsg('exiting_dialog'), |
- cvox.ChromeVoxEventWatcher.queueMode_(), |
- cvox.AbstractTts.PERSONALITY_ANNOTATION); |
+ cvox.TtsCategory.NAV); |
return true; |
} |
} else { |
if (dialog) { |
cvox.ChromeVox.navigationManager.currentDialog = dialog; |
- cvox.ChromeVox.tts.speak( |
+ cvox.ChromeVoxEventWatcher.speakAnnotationWithCategory_( |
cvox.ChromeVox.msgs.getMsg('entering_dialog'), |
- cvox.ChromeVoxEventWatcher.queueMode_(), |
- cvox.AbstractTts.PERSONALITY_ANNOTATION); |
+ cvox.TtsCategory.NAV); |
+ |
if (role == 'alertdialog') { |
var dialogDescArray = |
cvox.DescriptionUtil.getFullDescriptionsFromChildren(null, dialog); |
@@ -1353,6 +1352,29 @@ cvox.ChromeVoxEventWatcher.handleDialogFocus = function(target) { |
}; |
/** |
+ * Speak the given text with the annotation personality and the given |
+ * speech queue utterance category. |
+ * @param {string} text The text to speak. |
+ * @param {string} category The category of text, used by the speech queue |
+ * when flushing all speech from the same category while leaving other |
+ * speech in the queue. |
+ * @private |
+ */ |
+cvox.ChromeVoxEventWatcher.speakAnnotationWithCategory_ = function( |
+ text, category) { |
+ var properties = {}; |
+ var src = cvox.AbstractTts.PERSONALITY_ANNOTATION; |
+ for (var key in src) { |
+ properties[key] = src[key]; |
+ } |
+ properties['category'] = category; |
+ cvox.ChromeVox.tts.speak( |
+ text, |
+ cvox.ChromeVoxEventWatcher.queueMode_(), |
+ properties); |
+}; |
+ |
+/** |
* Returns true if we should wait to process events. |
* @param {number} lastFocusTimestamp The timestamp of the last focus event. |
* @param {number} firstTimestamp The timestamp of the first event. |