Chromium Code Reviews| 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 2920129c28d0bf7d3f7a54df80674c10a22a6cb9..e89ed9b7e37636bd746a6878582cd1088dbf18af 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 |
| @@ -62,6 +62,8 @@ DesktopAutomationHandler = function(node) { |
| this.onFocus); |
| this.addListener_(EventType.HOVER, |
| this.onHover); |
| + this.addListener_(EventType.IMAGE_FRAME_UPDATED, |
| + this.onImageFrameUpdated); |
| this.addListener_(EventType.INVALID_STATUS_CHANGED, |
| this.onEventIfInRange); |
| this.addListener_(EventType.LOAD_COMPLETE, |
| @@ -413,6 +415,33 @@ DesktopAutomationHandler.prototype = { |
| }, |
| /** |
| + * Provides all feedback once a image frame updated event fires. |
| + * @param {!AutomationEvent} evt |
| + */ |
| + onImageFrameUpdated: function(evt) { |
| + var node = evt.target; |
|
David Tseng
2017/02/22 18:15:24
I don't think you need most or any of this. If thi
|
| + if (!node) |
| + return; |
| + |
| + // If |node| is NOT in the current range, return |
| + var prevRange = ChromeVoxState.instance.currentRange; |
| + if (!prevRange.contentEquals(cursors.Range.fromNode(node)) && |
| + !node.state.focused) { |
| + return; |
| + } |
| + |
| + var output = new Output(); |
| + if (!this.textEditHandler_) { |
| + output.withBraille( |
| + ChromeVoxState.instance.currentRange, prevRange, evt.type); |
| + } else { |
| + // Delegate event handling to the text edit handler for braille. |
| + this.textEditHandler_.onEvent(evt); |
| + } |
| + output.go(); |
| + }, |
| + |
| + /** |
| * Provides all feedback once a value changed event fires. |
| * @param {!AutomationEvent} evt |
| */ |