Chromium Code Reviews| 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); |