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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js

Issue 596033002: Entering / exiting dialog notification should not interrupt live region. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@event_watcher_tests
Patch Set: Enum, and better test 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/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.

Powered by Google App Engine
This is Rietveld 408576698