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

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

Issue 2650733002: Revert of Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: 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 e4bd58312b4268dcd0d7a081a0e1350efb10e6d0..ee6e1d28c8b7adef7ed1b5fa4480a4880401bc6b 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -25,7 +25,6 @@
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;
@@ -52,7 +51,7 @@
* |valueChanged|.
* An implementation of this method should emit the appropritate braille and
* spoken feedback for the event.
- * @param {!(AutomationEvent|CustomAutomationEvent)} evt
+ * @param {!AutomationEvent} evt
*/
onEvent: goog.abstractMethod,
};
@@ -74,10 +73,10 @@
/** @override */
onEvent: function(evt) {
- if (evt.type !== EventType.TEXT_CHANGED &&
- evt.type !== EventType.TEXT_SELECTION_CHANGED &&
- evt.type !== EventType.VALUE_CHANGED &&
- evt.type !== EventType.FOCUS)
+ if (evt.type !== EventType.textChanged &&
+ evt.type !== EventType.textSelectionChanged &&
+ evt.type !== EventType.valueChanged &&
+ evt.type !== EventType.focus)
return;
if (!evt.target.state.focused ||
!evt.target.state.editable ||
@@ -102,13 +101,13 @@
var end = node.textSelEnd;
cvox.ChromeVoxEditableTextBase.call(
this,
- node.value || '',
+ node.value,
Math.min(start, end),
Math.max(start, end),
- node.state[StateType.PROTECTED] /**password*/,
+ node.state.protected /**password*/,
cvox.ChromeVox.tts);
/** @override */
- this.multiline = node.state[StateType.MULTILINE] || false;
+ this.multiline = node.state.multiline || false;
/** @type {!AutomationNode} @private */
this.node_ = node;
/** @type {Array<number>} @private */
@@ -122,15 +121,15 @@
* Called when the text field has been updated.
*/
onUpdate: function() {
- var newValue = this.node_.value || '';
+ var newValue = this.node_.value;
if (this.value != newValue)
this.lineBreaks_ = [];
var textChangeEvent = new cvox.TextChangeEvent(
newValue,
- this.node_.textSelStart || 0,
- this.node_.textSelEnd || 0,
+ this.node_.textSelStart,
+ this.node_.textSelEnd,
true /* triggered by user */);
this.changed(textChangeEvent);
this.outputBraille_();
@@ -208,7 +207,7 @@
var testNode = node;
do {
- if (testNode.state[StateType.FOCUSED] && testNode.state[StateType.EDITABLE])
+ if (testNode.state.focused && testNode.state.editable)
rootFocusedEditable = testNode;
testNode = testNode.parent;
} while (testNode);

Powered by Google App Engine
This is Rietveld 408576698