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

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

Issue 2601333002: Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Fix select_to_speak Created 3 years, 11 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 ee6e1d28c8b7adef7ed1b5fa4480a4880401bc6b..b2a9c6b086ccd0bca2fd4e517a991c69ac74b7c7 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -25,6 +25,7 @@ var Dir = AutomationUtil.Dir;
var EventType = chrome.automation.EventType;
var Range = cursors.Range;
var RoleType = chrome.automation.RoleType;
+var StateType = chrome.automation.StateType;
var Movement = cursors.Movement;
var Unit = cursors.Unit;
@@ -51,7 +52,7 @@ editing.TextEditHandler.prototype = {
* |valueChanged|.
* An implementation of this method should emit the appropritate braille and
* spoken feedback for the event.
- * @param {!AutomationEvent} evt
+ * @param {!(AutomationEvent|CustomAutomationEvent)} evt
*/
onEvent: goog.abstractMethod,
};
@@ -73,10 +74,10 @@ TextFieldTextEditHandler.prototype = {
/** @override */
onEvent: function(evt) {
- if (evt.type !== EventType.textChanged &&
- evt.type !== EventType.textSelectionChanged &&
- evt.type !== EventType.valueChanged &&
- evt.type !== EventType.focus)
+ if (evt.type !== EventType.TEXT_CHANGED &&
+ evt.type !== EventType.TEXT_SELECTION_CHANGED &&
+ evt.type !== EventType.VALUE_CHANGED &&
+ evt.type !== EventType.FOCUS)
return;
if (!evt.target.state.focused ||
!evt.target.state.editable ||
@@ -104,10 +105,10 @@ function AutomationEditableText(node) {
node.value,
Math.min(start, end),
Math.max(start, end),
- node.state.protected /**password*/,
+ node.state[StateType.PROTECTED] /**password*/,
cvox.ChromeVox.tts);
/** @override */
- this.multiline = node.state.multiline || false;
+ this.multiline = node.state[StateType.MULTILINE] || false;
/** @type {!AutomationNode} @private */
this.node_ = node;
/** @type {Array<number>} @private */
@@ -207,7 +208,7 @@ editing.TextEditHandler.createForNode = function(node) {
var testNode = node;
do {
- if (testNode.state.focused && testNode.state.editable)
+ if (testNode.state[StateType.FOCUSED] && testNode.state[StateType.EDITABLE])
rootFocusedEditable = testNode;
testNode = testNode.parent;
} while (testNode);

Powered by Google App Engine
This is Rietveld 408576698