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

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

Issue 2813743002: Switch to selected 8-dot braille table in email and url text fields (Closed)
Patch Set: Fixes corner cases (liblouis callbacks sometimes drop when called quickly). Created 3 years, 8 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/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
index 8cbf6bba7f2f8f726114e0dd3943b107a25a3eab..337379713db30ad8bf057cf41dd4ec4b8177729a 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/chromevox_state.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/chromevox_state.js
@@ -10,8 +10,10 @@
goog.provide('ChromeVoxMode');
goog.provide('ChromeVoxState');
+goog.provide('ChromeVoxStateObserver');
goog.require('cursors.Cursor');
+goog.require('cursors.Range');
/**
* All possible modes ChromeVox can run.
@@ -25,6 +27,20 @@ ChromeVoxMode = {
};
/**
+ * An interface implemented by objects that want to observe ChromeVox state
+ * changes.
+ * @interface
+ */
+ChromeVoxStateObserver = function() {};
+
+ChromeVoxStateObserver.prototype = {
+ /**
+ * @param {cursors.Range} range The new range.
+ */
+ onCurrentRangeChanged: function(range) {}
+};
+
+/**
* ChromeVox2 state object.
* @constructor
*/
@@ -80,5 +96,15 @@ ChromeVoxState.prototype = {
/**
* @param {cursors.Range} newRange The new range.
*/
- setCurrentRange: goog.abstractMethod,
+ setCurrentRange: goog.abstractMethod
+};
+
+/** @type {!Array<ChromeVoxStateObserver>} */
+ChromeVoxState.observers = [];
+
+/**
+ * @param {ChromeVoxStateObserver} observer
+ */
+ChromeVoxState.addObserver = function(observer) {
+ this.observers.push(observer);
};

Powered by Google App Engine
This is Rietveld 408576698