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

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

Issue 2795083003: Add support for in-page links in ChromeVox. (Closed)
Patch Set: Address nit. Created 3 years, 8 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 if (node) 449 if (node)
450 current = cursors.Range.fromNode(node); 450 current = cursors.Range.fromNode(node);
451 break; 451 break;
452 case 'jumpToBottom': 452 case 'jumpToBottom':
453 var node = AutomationUtil.findNodePost( 453 var node = AutomationUtil.findNodePost(
454 current.start.node.root, Dir.BACKWARD, AutomationPredicate.leaf); 454 current.start.node.root, Dir.BACKWARD, AutomationPredicate.leaf);
455 if (node) 455 if (node)
456 current = cursors.Range.fromNode(node); 456 current = cursors.Range.fromNode(node);
457 break; 457 break;
458 case 'forceClickOnCurrentItem': 458 case 'forceClickOnCurrentItem':
459 if (ChromeVoxState.instance.currentRange_) { 459 if (ChromeVoxState.instance.currentRange) {
460 var actionNode = ChromeVoxState.instance.currentRange_.start.node; 460 var actionNode = ChromeVoxState.instance.currentRange.start.node;
461 if (actionNode.role == RoleType.INLINE_TEXT_BOX) 461 while (actionNode.role == RoleType.INLINE_TEXT_BOX ||
462 actionNode.role == RoleType.STATIC_TEXT)
462 actionNode = actionNode.parent; 463 actionNode = actionNode.parent;
463 actionNode.doDefault(); 464 if (actionNode.inPageLinkTarget) {
465 ChromeVoxState.instance.navigateToRange(
466 cursors.Range.fromNode(actionNode.inPageLinkTarget));
467 } else {
468 actionNode.doDefault();
469 }
464 } 470 }
465 // Skip all other processing; if focus changes, we should get an event 471 // Skip all other processing; if focus changes, we should get an event
466 // for that. 472 // for that.
467 return false; 473 return false;
468 case 'readFromHere': 474 case 'readFromHere':
469 ChromeVoxState.isReadingContinuously = true; 475 ChromeVoxState.isReadingContinuously = true;
470 var continueReading = function() { 476 var continueReading = function() {
471 if (!ChromeVoxState.isReadingContinuously || 477 if (!ChromeVoxState.isReadingContinuously ||
472 !ChromeVoxState.instance.currentRange_) 478 !ChromeVoxState.instance.currentRange_)
473 return; 479 return;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 if (imageNode.imageDataUrl) { 854 if (imageNode.imageDataUrl) {
849 var event = new CustomAutomationEvent( 855 var event = new CustomAutomationEvent(
850 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page'); 856 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page');
851 CommandHandler.onImageFrameUpdated_(event); 857 CommandHandler.onImageFrameUpdated_(event);
852 } else { 858 } else {
853 imageNode.getImageData(0, 0); 859 imageNode.getImageData(0, 0);
854 } 860 }
855 }; 861 };
856 862
857 }); // goog.scope 863 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698