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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview ChromeVox commands. 6 * @fileoverview ChromeVox commands.
7 */ 7 */
8 8
9 goog.provide('CommandHandler'); 9 goog.provide('CommandHandler');
10 10
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 ChromeVoxState.instance.pageSel_ = null; 571 ChromeVoxState.instance.pageSel_ = null;
572 return false; 572 return false;
573 } 573 }
574 break; 574 break;
575 case 'fullyDescribe': 575 case 'fullyDescribe':
576 var o = new Output(); 576 var o = new Output();
577 o.withContextFirst() 577 o.withContextFirst()
578 .withRichSpeechAndBraille(current, null, Output.EventType.NAVIGATE) 578 .withRichSpeechAndBraille(current, null, Output.EventType.NAVIGATE)
579 .go(); 579 .go();
580 return false; 580 return false;
581 581 case 'viewGraphicAsBraille':
582 // Find the first node within the current range that supports image data.
583 var imageNode = AutomationUtil.findNodePost(
584 current.start.node, Dir.FORWARD,
585 AutomationPredicate.supportsImageData);
586 if (imageNode) {
587 ChromeVoxState.instance.nodeDisplayingBrailleImage = imageNode;
588 if (imageNode.imageDataUrl) {
589 cvox.ChromeVox.braille.writeRawImage(imageNode.imageDataUrl);
590 cvox.ChromeVox.braille.freeze();
591 } else {
592 // Request image data. If it succeeds, we will get a
593 // IMAGE_FRAME_UPDATED event.
594 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.
595 }
596 }
597 return false;
582 // Table commands. 598 // Table commands.
583 case 'previousRow': 599 case 'previousRow':
584 dir = Dir.BACKWARD; 600 dir = Dir.BACKWARD;
585 var tableOpts = {row: true, dir: dir}; 601 var tableOpts = {row: true, dir: dir};
586 pred = AutomationPredicate.makeTableCellPredicate( 602 pred = AutomationPredicate.makeTableCellPredicate(
587 current.start.node, tableOpts); 603 current.start.node, tableOpts);
588 predErrorMsg = 'no_cell_above'; 604 predErrorMsg = 'no_cell_above';
589 rootPred = AutomationPredicate.table; 605 rootPred = AutomationPredicate.table;
590 break; 606 break;
591 case 'previousCol': 607 case 'previousCol':
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 break; 784 break;
769 } 785 }
770 if (announcement) { 786 if (announcement) {
771 cvox.ChromeVox.tts.speak( 787 cvox.ChromeVox.tts.speak(
772 announcement, cvox.QueueMode.FLUSH, 788 announcement, cvox.QueueMode.FLUSH,
773 cvox.AbstractTts.PERSONALITY_ANNOTATION); 789 cvox.AbstractTts.PERSONALITY_ANNOTATION);
774 } 790 }
775 }; 791 };
776 792
777 }); // goog.scope 793 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698