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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js

Issue 2740793002: Minimize the Classic API and enable it for Next (Closed)
Patch Set: Minimize the Classic API and enable it for Next 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js
index a7ed82ff6d02d2166edc72aae42b86ca577e3c4d..63468417c1fbb7daee52187da789f05e5fbf8283 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/navigation_manager.js
@@ -15,6 +15,7 @@
goog.provide('cvox.NavigationManager');
goog.require('cvox.ActiveIndicator');
+goog.require('cvox.AriaUtil');
goog.require('cvox.ChromeVox');
goog.require('cvox.ChromeVoxEventSuspender');
goog.require('cvox.CursorSelection');
@@ -383,6 +384,52 @@ cvox.NavigationManager.prototype.syncAll = function(opt_skipText) {
/**
+ * Synchronizes ChromeVox's internal cursor to the targetNode.
+ * Note that this will NOT trigger reading unless given the optional argument;
+ * it is for setting the internal ChromeVox cursor so that when the user resumes
+ * reading, they will be starting from a reasonable position.
+ *
+ * @param {Node} targetNode The node that ChromeVox should be synced to.
+ * @param {boolean=} opt_speakNode If true, speaks out the node.
+ * @param {number=} opt_queueMode The queue mode to use for speaking.
+ */
+cvox.NavigationManager.prototype.syncToNode = function(
+ targetNode, opt_speakNode, opt_queueMode) {
+ if (!cvox.ChromeVox.isActive) {
+ return;
+ }
+
+ if (opt_queueMode == undefined) {
+ opt_queueMode = cvox.QueueMode.CATEGORY_FLUSH;
+ }
+
+ this.updateSelToArbitraryNode(targetNode, true);
+ this.updateIndicator();
+
+ if (opt_speakNode == undefined) {
+ opt_speakNode = false;
+ }
+
+ // Don't speak anything if the node is hidden or invisible.
+ if (cvox.AriaUtil.isHiddenRecursive(targetNode)) {
+ opt_speakNode = false;
+ }
+
+ if (opt_speakNode) {
+ this.speakDescriptionArray(this.getDescription(),
+ /** @type {cvox.QueueMode} */ (opt_queueMode),
+ null,
+ null,
+ cvox.TtsCategory.NAV);
+ }
+
+ cvox.ChromeVox.braille.write(this.getBraille());
+
+ this.updatePosition(targetNode);
+};
+
+
+/**
* Clears a DOM selection made via a CursorSelection.
* @param {boolean=} opt_announce True to announce the clearing.
* @return {boolean} If a selection was cleared.

Powered by Google App Engine
This is Rietveld 408576698