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

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

Issue 2544203004: Display images in multiline Braille
Patch Set: Minor Nits, added TODO comments Created 4 years 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 bbb2bfa2bf28882b9aee56b546c4bcd796951512..7d3aeabab611b66f9f3040897dfdae7116624b01 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
@@ -65,6 +65,7 @@ DesktopAutomationHandler = function(node) {
this.addListener_(e.textChanged, this.onTextChanged);
this.addListener_(e.textSelectionChanged, this.onTextSelectionChanged);
this.addListener_(e.valueChanged, this.onValueChanged);
+ this.addListener_(e.imageFrameUpdated, this.onImageFrameUpdated);
AutomationObjectConstructorInstaller.init(node, function() {
chrome.automation.getFocus((function(focus) {
@@ -386,6 +387,33 @@ DesktopAutomationHandler.prototype = {
},
/**
+ * Provides all feedback once a image frame updated event fires.
+ * @param {!AutomationEvent} evt
+ */
+ onImageFrameUpdated: function(evt) {
+ var node = evt.target;
+ 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
*/

Powered by Google App Engine
This is Rietveld 408576698