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

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

Issue 2703663002: Display images in multiline Braille (Closed)
Patch Set: Use freeze / thaw Created 3 years, 10 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/command_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
index e483f40de44b8eb657e834ab9f28c9904ab2851c..80700d9185bd631b5a07c8cc81b298b819fc0db8 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
@@ -578,7 +578,23 @@ CommandHandler.onCommand = function(command) {
.withRichSpeechAndBraille(current, null, Output.EventType.NAVIGATE)
.go();
return false;
-
+ case 'viewGraphicAsBraille':
+ // Find the first node within the current range that supports image data.
+ var imageNode = AutomationUtil.findNodePost(
+ current.start.node, Dir.FORWARD,
+ AutomationPredicate.supportsImageData);
+ if (imageNode) {
+ ChromeVoxState.instance.nodeDisplayingBrailleImage = imageNode;
+ if (imageNode.imageDataUrl) {
+ cvox.ChromeVox.braille.writeRawImage(imageNode.imageDataUrl);
+ cvox.ChromeVox.braille.freeze();
+ } else {
+ // Request image data. If it succeeds, we will get a
+ // IMAGE_FRAME_UPDATED event.
+ imageNode.getImageData(0, 0);
David Tseng 2017/02/24 05:39:46 I think we should install the event handler direct
dmazzoni 2017/02/27 06:56:24 Done.
+ }
+ }
+ return false;
// Table commands.
case 'previousRow':
dir = Dir.BACKWARD;

Powered by Google App Engine
This is Rietveld 408576698