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

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

Issue 2601333002: Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Address lots of feedback 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/command_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
index 3ae083c2eae0c3b9431e39c82eaaecaace0ab395..03470c6e9faf76d26068125c81d44e5094e63123 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
@@ -42,8 +42,8 @@ CommandHandler.onCommand = function(command) {
case 'speakTimeAndDate':
chrome.automation.getDesktop(function(d) {
// First, try speaking the on-screen time.
- var allTime = d.findAll({role: RoleType.time});
- allTime.filter(function(t) { return t.root.role == RoleType.desktop; });
+ var allTime = d.findAll({role: RoleType.TIME});
+ allTime.filter(function(t) { return t.root.role == RoleType.DESKTOP; });
var timeString = '';
allTime.forEach(function(t) {
@@ -448,7 +448,7 @@ CommandHandler.onCommand = function(command) {
case 'forceClickOnCurrentItem':
if (ChromeVoxState.instance.currentRange_) {
var actionNode = ChromeVoxState.instance.currentRange_.start.node;
- if (actionNode.role == RoleType.inlineTextBox)
+ if (actionNode.role == RoleType.INLINE_TEXT_BOX)
actionNode = actionNode.parent;
actionNode.doDefault();
}
@@ -469,8 +469,8 @@ CommandHandler.onCommand = function(command) {
// Stop if we've wrapped back to the document.
var maybeDoc = newRange.start.node;
- if (maybeDoc.role == RoleType.rootWebArea &&
- maybeDoc.parent.root.role == RoleType.desktop) {
+ if (maybeDoc.role == RoleType.ROOT_WEB_AREA &&
+ maybeDoc.parent.root.role == RoleType.DESKTOP) {
ChromeVoxState.isReadingContinuously = false;
return;
}
@@ -496,7 +496,7 @@ CommandHandler.onCommand = function(command) {
case 'contextMenu':
if (ChromeVoxState.instance.currentRange_) {
var actionNode = ChromeVoxState.instance.currentRange_.start.node;
- if (actionNode.role == RoleType.inlineTextBox)
+ if (actionNode.role == RoleType.INLINE_TEXT_BOX)
actionNode = actionNode.parent;
actionNode.showContextMenu();
return false;
@@ -527,13 +527,13 @@ CommandHandler.onCommand = function(command) {
var target = ChromeVoxState.instance.currentRange_.start.node;
var output = new Output();
- if (target.root.role == RoleType.rootWebArea) {
+ if (target.root.role == RoleType.ROOT_WEB_AREA) {
// Web.
target = target.root;
output.withString(target.name || target.docUrl);
} else {
// Views.
- while (target.role != RoleType.window) target = target.parent;
+ while (target.role != RoleType.WINDOW) target = target.parent;
if (target)
output.withString(target.name || '');
}
@@ -618,7 +618,7 @@ CommandHandler.onCommand = function(command) {
case 'goToRowFirstCell':
case 'goToRowLastCell':
var node = current.start.node;
- while (node && node.role != RoleType.row)
+ while (node && node.role != RoleType.ROW)
node = node.parent;
if (!node)
break;
@@ -631,7 +631,7 @@ CommandHandler.onCommand = function(command) {
case 'goToColFirstCell':
dir = Dir.FORWARD;
var node = current.start.node;
- while (node && node.role != RoleType.table)
+ while (node && node.role != RoleType.TABLE)
node = node.parent;
if (!node || !node.firstChild)
return false;
@@ -646,7 +646,7 @@ CommandHandler.onCommand = function(command) {
case 'goToColLastCell':
dir = Dir.BACKWARD;
var node = current.start.node;
- while (node && node.role != RoleType.table)
+ while (node && node.role != RoleType.TABLE)
node = node.parent;
if (!node || !node.lastChild)
return false;
@@ -661,7 +661,7 @@ CommandHandler.onCommand = function(command) {
case 'goToFirstCell':
case 'goToLastCell':
node = current.start.node;
- while (node && node.role != RoleType.table)
+ while (node && node.role != RoleType.TABLE)
node = node.parent;
if (!node)
break;

Powered by Google App Engine
This is Rietveld 408576698