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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js

Issue 2331253002: Use category flush for focus events. (Closed)
Patch Set: fix test Created 4 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/cvox2/background/desktop_automation_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
index 26c6cbc9fc02e5109d4c7f1ad6534cc1bc1bffd6..2c91ce05ca6528ddfdb14edfe1ac80b0d4973071 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
@@ -176,7 +176,7 @@ DesktopAutomationHandler.prototype = {
* @param {!AutomationEvent} evt
*/
onEventWithFlushedOutput: function(evt) {
- Output.flushNextSpeechUtterance();
+ Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH);
this.onEventDefault(evt);
},
@@ -187,7 +187,7 @@ DesktopAutomationHandler.prototype = {
if (ChromeVoxState.instance.currentRange &&
evt.target == ChromeVoxState.instance.currentRange.start.node)
return;
- Output.flushNextSpeechUtterance();
+ Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH);
this.onEventDefault(evt);
},
@@ -251,12 +251,10 @@ DesktopAutomationHandler.prototype = {
this.createTextEditHandlerIfNeeded_(evt.target);
- // Since we queue output mostly for live regions support and there isn't a
- // reliable way to know if this focus event resulted from a user's explicit
- // action, only flush when the focused node is not web content.
- if (node.root.role == RoleType.desktop)
- Output.flushNextSpeechUtterance();
-
+ // Category flush speech triggered by events with no source. This includes
+ // views.
+ if (evt.eventFrom == '')
+ Output.forceModeForNextSpeechUtterance(cvox.QueueMode.CATEGORY_FLUSH);
this.onEventDefault(new chrome.automation.AutomationEvent(
EventType.focus, node, evt.eventFrom));
},
@@ -424,7 +422,7 @@ DesktopAutomationHandler.prototype = {
var override = evt.target.role == RoleType.menuItem ||
(evt.target.root == focus.root &&
focus.root.role == RoleType.desktop);
- Output.flushNextSpeechUtterance();
+ Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH);
if (override || AutomationUtil.isDescendantOf(evt.target, focus))
this.onEventDefault(evt);
}.bind(this));

Powered by Google App Engine
This is Rietveld 408576698