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

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

Issue 674263003: Add remaining text/caret navigation commands to ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@integrate_cursor
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
index 6bde6b1e846b6ec9ccb62f52b8ee931063e022a4..f6d1a877e77618079c8c6ebf7038ac5d8dd29b61 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -144,6 +144,18 @@ Background.prototype = {
dir = Dir.BACKWARD;
pred = AutomationPredicate.heading;
break;
+ case 'nextCharacter':
+ current = current.move(cursors.Unit.CHARACTER, Dir.FORWARD);
+ break;
+ case 'previousCharacter':
+ current = current.move(cursors.Unit.CHARACTER, Dir.BACKWARD);
+ break;
+ case 'nextWord':
+ current = current.move(cursors.Unit.WORD, Dir.FORWARD);
+ break;
+ case 'previousWord':
+ current = current.move(cursors.Unit.WORD, Dir.BACKWARD);
+ break;
case 'nextLine':
current = current.move(cursors.Unit.LINE, Dir.FORWARD);
break;
@@ -318,6 +330,14 @@ Background.prototype = {
output += getCursorDesc(range.getEnd());
nodeLocations.push(range.getEnd().getNode().location);
+ // Read subnode ranges.
+ if (range.getStart().getNode() === range.getEnd().getNode()) {
dmazzoni 2014/10/27 07:06:20 Suppose I'm moving by words and I move from the la
+ var startIndex = range.getStart().getIndex();
+ var endIndex = range.getEnd().getIndex();
+ if (startIndex > -1 && endIndex > -1)
+ output = range.getStart().getText().substring(startIndex, endIndex);
+ }
+
cvox.ChromeVox.tts.speak(output, cvox.QueueMode.FLUSH);
cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(output));
chrome.accessibilityPrivate.setFocusRing(nodeLocations);
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698