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); |