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

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

Issue 1457683009: Complete live region support in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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/chromevox_state.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/chromevox_state.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/chromevox_state.js
new file mode 100644
index 0000000000000000000000000000000000000000..4fa0afdb673cf956324c8fc4579d38fccc43b0da
--- /dev/null
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/chromevox_state.js
@@ -0,0 +1,73 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview An interface for querying and modifying the global
+ * ChromeVox state, to avoid direct dependencies on the Background
+ * object and to facilitate mocking for tests.
+ */
+
+goog.provide('ChromeVoxMode');
+goog.provide('ChromeVoxState');
+
+goog.require('cursors.Cursor');
+
+/**
+ * All possible modes ChromeVox can run.
+ * @enum {string}
+ */
+ChromeVoxMode = {
+ CLASSIC: 'classic',
+ COMPAT: 'compat',
+ NEXT: 'next',
+ FORCE_NEXT: 'force_next'
+};
+
+/**
+ * ChromeVox2 state object.
+ * @constructor
+ */
+ChromeVoxState = function() {
+};
+
+ChromeVoxState.prototype = {
+ /** @type {ChromeVoxMode} */
+ get mode() {
+ return this.getMode();
+ },
+
+ /**
+ * @return {ChromeVoxMode} The current mode.
+ */
+ getMode: function() {
+ return ChromeVoxMode.NEXT;
+ },
+
+ /**
+ * Sets the current ChromeVox mode.
+ * @param {ChromeVoxMode} mode
+ * @param {boolean=} opt_injectClassic Injects ChromeVox classic into tabs;
+ * defaults to false.
+ */
+ setMode: function(mode, opt_injectClassic) {
+ },
+
+ /** @type {cursors.Range} */
+ get currentRange() {
+ return this.getCurrentRange();
+ },
+
+ /**
+ * @return {cursors.Range} The current range.
+ */
+ getCurrentRange: function() {
Peter Lundblad 2015/11/24 11:04:31 Perhaps make the get* methods private to enforce c
dmazzoni 2015/11/30 22:00:47 Done.
+ return null;
+ },
+
+ /**
+ * @param {cursors.Range} newRange The new range.
+ */
+ setCurrentRange: function(newRange) {
Peter Lundblad 2015/11/24 11:04:31 How about making all these 'stub' methods goog.abs
dmazzoni 2015/11/30 22:00:47 Done.
dmazzoni 2015/12/01 08:19:47 Hmmm, I tried this but got weird errors because th
+ },
+};

Powered by Google App Engine
This is Rietveld 408576698