Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| index 453b1d25c674e3d8bce6b869e26a8d65b126718e..65ff71f7286a59d4f78a80bf2759e95f0c54bacc 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| @@ -427,6 +427,7 @@ Background.prototype = { |
| var dir = Dir.FORWARD; |
| var pred = null; |
| var predErrorMsg = undefined; |
| + var rootPred = AutomationPredicate.root; |
| var speechProps = {}; |
| switch (command) { |
| case 'nextCharacter': |
| @@ -796,6 +797,118 @@ Background.prototype = { |
| cvox.BrailleCaptionsBackground.setActive( |
| !cvox.BrailleCaptionsBackground.isEnabled()); |
| return false; |
| + case 'fullyDescribe': |
| + var o = new Output(); |
| + o.withContextFirst() |
| + .withRichSpeechAndBraille(current, null, Output.EventType.NAVIGATE) |
| + .go(); |
| + return false; |
| + |
| + // Table commands. |
| + case 'previousRow': |
| + var tableOpts = {}; |
|
dmazzoni
2016/07/13 23:38:28
Any reason not to make this more concise? t doesn'
David Tseng
2016/07/14 20:24:41
dir gets used in both places; the first is to calc
|
| + tableOpts.row = true; |
| + dir = Dir.BACKWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + predErrorMsg = 'no_cell_above'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'previousCol': |
| + var tableOpts = {}; |
| + tableOpts.col = true; |
| + dir = Dir.BACKWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + predErrorMsg = 'no_cell_left'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'nextRow': |
| + var tableOpts = {}; |
| + tableOpts.row = true; |
| + dir = Dir.FORWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + predErrorMsg = 'no_cell_below'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'nextCol': |
| + var tableOpts = {}; |
| + tableOpts.col = true; |
| + dir = Dir.FORWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + predErrorMsg = 'no_cell_right'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'goToRowFirstCell': |
| + var tableOpts = {}; |
| + tableOpts.row = true; |
| + tableOpts.end = true; |
| + dir = Dir.BACKWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + // Should not be outputted. |
| + predErrorMsg = 'no_cell_left'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'goToRowLastCell': |
| + var tableOpts = {}; |
| + tableOpts.row = true; |
| + tableOpts.end = true; |
| + dir = Dir.FORWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + // Should not be outputted. |
| + predErrorMsg = 'no_cell_right'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'goToColFirstCell': |
| + var tableOpts = {}; |
| + tableOpts.col = true; |
| + tableOpts.end = true; |
| + dir = Dir.BACKWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + // Should not be outputted. |
| + predErrorMsg = 'no_cell_above'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'goToColLastCell': |
| + var tableOpts = {}; |
| + tableOpts.col = true; |
| + tableOpts.end = true; |
| + dir = Dir.FORWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + // Should not be outputted. |
| + predErrorMsg = 'no_cell_below'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'goToFirstCell': |
| + var tableOpts = {}; |
| + tableOpts.row = true; |
| + tableOpts.col = true; |
| + tableOpts.end = true; |
| + dir = Dir.BACKWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + // Should not be outputted. |
| + predErrorMsg = 'no_cell_left'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| + case 'goToLastCell': |
| + var tableOpts = {}; |
| + tableOpts.row = true; |
| + tableOpts.col = true; |
| + tableOpts.end = true; |
| + dir = Dir.FORWARD; |
| + tableOpts.dir = dir; |
| + pred = AutomationPredicate.rowCol(current.start.node, tableOpts); |
| + // Should not be outputted. |
| + predErrorMsg = 'no_cell_right'; |
| + rootPred = AutomationPredicate.table; |
| + break; |
| default: |
| return true; |
| } |
| @@ -804,7 +917,7 @@ Background.prototype = { |
| var bound = current.getBound(dir).node; |
| if (bound) { |
| var node = AutomationUtil.findNextNode( |
| - bound, dir, pred, {skipInitialAncestry: true}); |
| + bound, dir, pred, {skipInitialAncestry: true, root: rootPred}); |
| if (node) { |
| node = AutomationUtil.findNodePre( |