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

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

Issue 2813743002: Switch to selected 8-dot braille table in email and url text fields (Closed)
Patch Set: Address feedback. 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/editing.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
index e4bd58312b4268dcd0d7a081a0e1350efb10e6d0..75fd6615348fd7f03dfa4b27b13c75e47efd102d 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -15,6 +15,7 @@ goog.require('Output');
goog.require('Output.EventType');
goog.require('cursors.Cursor');
goog.require('cursors.Range');
+goog.require('cvox.BrailleBackground');
goog.require('cvox.ChromeVoxEditableTextBase');
goog.scope(function() {
@@ -38,6 +39,12 @@ var Unit = cursors.Unit;
editing.TextEditHandler = function(node) {
/** @const {!AutomationNode} @private */
this.node_ = node;
+
+ // Refresh braille translation.
+ if (node.inputType == 'email' || node.inputType == 'url') {
+ cvox.BrailleBackground.getInstance().getTranslatorManager().refresh(
+ localStorage['brailleTable8']);
+ }
};
editing.TextEditHandler.prototype = {
@@ -47,6 +54,16 @@ editing.TextEditHandler.prototype = {
},
/**
+ * Invalidates this handler. A caller must invalidate this handler for it to
+ * properly reset any intermediate actions it took on behalf of a user.
+ */
+ invalidate: function() {
+ // Refresh back to user's table selection.
+ cvox.BrailleBackground.getInstance().getTranslatorManager().refresh(
+ localStorage['brailleTable']);
+ },
+
+ /**
* Receives the following kinds of events when the node provided to the
* constructor is focuse: |focus|, |textChanged|, |textSelectionChanged| and
* |valueChanged|.

Powered by Google App Engine
This is Rietveld 408576698