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

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: Add comments. 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
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..5bb97e200e8b63b63049a2e931be4fb4b514c145 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -12,6 +12,7 @@ goog.provide('global');
goog.require('AutomationPredicate');
goog.require('AutomationUtil');
+goog.require('Output');
goog.require('cursors.Cursor');
goog.require('cvox.TabsApiHandler');
@@ -58,6 +59,12 @@ Background = function() {
*/
this.active_ = false;
+ /**
+ * @type {!Output}
+ * @private
+ */
+ this.output_ = new Output();
+
// Only needed with unmerged ChromeVox classic loaded before.
global.accessibility.setAccessibilityEnabled(false);
@@ -144,6 +151,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;
@@ -194,7 +213,7 @@ Background.prototype = {
current.getStart().getNode().focus();
this.currentRange_ = current;
- this.handleOutput(this.currentRange_);
+ this.output_.output(this.currentRange_);
}
},
@@ -208,7 +227,7 @@ Background.prototype = {
return;
this.currentRange_ = cursors.Range.fromNode(node);
- this.handleOutput(this.currentRange_);
+ this.output_.output(this.currentRange_);
},
/**
@@ -226,7 +245,7 @@ Background.prototype = {
this.currentRange_ = cursors.Range.fromNode(node);
if (this.currentRange_)
- this.handleOutput(this.currentRange_);
+ this.output_.output(this.currentRange_);
},
/**

Powered by Google App Engine
This is Rietveld 408576698