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

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

Issue 2080573003: Track all changed nodes during an update (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make suggested change. 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 4c3e3d42c0f0ba27e40f7fc29a75fa8364a1fe45..26c6cbc9fc02e5109d4c7f1ad6534cc1bc1bffd6 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
@@ -32,6 +32,7 @@ DesktopAutomationHandler = function(node) {
/**
* The object that speaks changes to an editable text field.
* @type {editing.TextEditHandler}
+ * @private
*/
this.textEditHandler_ = null;
@@ -72,7 +73,8 @@ DesktopAutomationHandler = function(node) {
if (focus) {
this.onFocus(
- new chrome.automation.AutomationEvent(EventType.focus, focus));
+ new chrome.automation.AutomationEvent(
+ EventType.focus, focus, 'page'));
}
}).bind(this));
}.bind(this));
@@ -84,6 +86,12 @@ DesktopAutomationHandler = function(node) {
*/
DesktopAutomationHandler.VMIN_VALUE_CHANGE_DELAY_MS = 500;
+/**
+ * Controls announcement of non-user-initiated events.
+ * @type {boolean}
+ */
+DesktopAutomationHandler.announceActions = false;
+
DesktopAutomationHandler.prototype = {
__proto__: BaseAutomationHandler.prototype,
@@ -118,6 +126,10 @@ DesktopAutomationHandler.prototype = {
ChromeVoxState.instance.currentRange.equals(prevRange))
return;
+ // Decide whether to announce this event.
+ if (!DesktopAutomationHandler.announceActions && evt.eventFrom == 'action')
+ return;
+
var output = new Output();
output.withRichSpeech(
ChromeVoxState.instance.currentRange, prevRange, evt.type);
@@ -187,7 +199,7 @@ DesktopAutomationHandler.prototype = {
if (!evt.target.activeDescendant || !evt.target.state.focused)
return;
this.onEventDefault(new chrome.automation.AutomationEvent(
- EventType.focus, evt.target.activeDescendant));
+ EventType.focus, evt.target.activeDescendant, evt.eventFrom));
},
/**
@@ -220,7 +232,7 @@ DesktopAutomationHandler.prototype = {
this.onEventIfInRange(
new chrome.automation.AutomationEvent(
- EventType.checkedStateChanged, evt.target));
+ EventType.checkedStateChanged, evt.target, evt.eventFrom));
},
/**
@@ -245,8 +257,8 @@ DesktopAutomationHandler.prototype = {
if (node.root.role == RoleType.desktop)
Output.flushNextSpeechUtterance();
- this.onEventDefault(
- new chrome.automation.AutomationEvent(EventType.focus, node));
+ this.onEventDefault(new chrome.automation.AutomationEvent(
+ EventType.focus, node, evt.eventFrom));
},
/**

Powered by Google App Engine
This is Rietveld 408576698