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..66ad2ce85340a6b083a424ea9a49608e3fd9281d 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,21 @@ DesktopAutomationHandler.prototype = { |
| }, |
| /** |
| + * Provides all feedback once a image frame updated event fires. |
| + * @param {!AutomationEvent} evt |
| + */ |
| + onImageFrameUpdated: function(evt) { |
|
David Tseng
2017/02/24 05:39:46
Please move this event handler to CommandHandler (
dmazzoni
2017/02/27 06:56:24
Done.
|
| + var node = evt.target; |
| + if (!node || node != ChromeVoxState.instance.nodeDisplayingBrailleImage) |
| + return; |
| + |
| + if (node.imageDataUrl) { |
| + cvox.ChromeVox.braille.writeRawImage(node.imageDataUrl); |
| + cvox.ChromeVox.braille.freeze(); |
| + } |
| + }, |
| + |
| + /** |
| * Provides all feedback once a value changed event fires. |
| * @param {!AutomationEvent} evt |
| */ |