Commit 89f913ae authored by David Tseng's avatar David Tseng Committed by Commit Bot

Refresh ChromeVox CommandStore

1. make updates so that the ChromeVox menus are up to date (e.g. remove the prefix key command, remove the ChromeVox activate/deactivate command from the menus).
2. apply the |disallowOOBE| bit to appropriate commands; remove it from the help command.
3. add support for |disallowOOBE| to CommandHandler

Bug: 921803
Change-Id: Ia3ff73c90b2c4aa94a455ccd9cc15ec20f4c0a41
Reviewed-on: https://chromium-review.googlesource.com/c/1436016
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626259}
parent 2c1589ff
......@@ -138,13 +138,6 @@ cvox.CommandStore.CMD_WHITELIST = {
'disallowOOBE': true,
category: 'modifier_keys'
},
'toggleKeyPrefix': {
announce: false,
skipInput: true,
msgId: 'prefix_key',
'disallowOOBE': true,
category: 'modifier_keys'
},
'passThroughMode': {
announce: false,
msgId: 'pass_through_key_description',
......@@ -161,15 +154,9 @@ cvox.CommandStore.CMD_WHITELIST = {
'toggleChromeVox': {
announce: false,
platformFilter: cvox.PlatformFilter.WML,
msgId: 'toggle_chromevox_active',
category: 'modifier_keys'
msgId: 'toggle_chromevox_active'
},
'toggleChromeVoxVersion': {announce: false},
'showNextUpdatePage': {
msgId: 'show_next_update_description',
announce: false,
'category': 'help_commands'
},
'openChromeVoxMenus': {announce: false, msgId: 'menus_title'},
'decreaseTtsRate': {
announce: false,
......@@ -413,7 +400,6 @@ cvox.CommandStore.CMD_WHITELIST = {
'help': {
announce: false,
msgId: 'help',
'disallowOOBE': true,
disallowContinuation: true,
category: 'help_commands'
},
......@@ -438,12 +424,17 @@ cvox.CommandStore.CMD_WHITELIST = {
'disallowOOBE': true,
category: 'help_commands'
},
'showTtsSettings':
{announce: false, msgId: 'show_tts_settings', category: 'help_commands'},
'showTtsSettings': {
announce: false,
msgId: 'show_tts_settings',
category: 'help_commands',
disallowOOBE: true
},
'toggleBrailleCaptions':
{announce: false, msgId: 'braille_captions', category: 'help_commands'},
'reportIssue': {
announce: false,
disallowOOBE: true,
msgId: 'panel_menu_item_report_issue',
category: 'help_commands'
},
......
......@@ -27,10 +27,10 @@ TEST_F('ChromeVoxCommandStoreUnitTest', 'TableData', function() {
assertEquals(11, categories.length);
assertEquals('modifier_keys', categories[0]);
assertEquals('controlling_speech', categories[1]);
assertEquals('help_commands', categories[2]);
assertEquals('navigation', categories[3]);
assertEquals('actions', categories[4]);
assertEquals('information', categories[5]);
assertEquals('navigation', categories[2]);
assertEquals('actions', categories[3]);
assertEquals('information', categories[4]);
assertEquals('help_commands', categories[5]);
assertEquals('overview', categories[6]);
assertEquals('jump_commands', categories[7]);
assertEquals('tables', categories[8]);
......
......@@ -14,8 +14,9 @@ goog.require('LogStore');
goog.require('Output');
goog.require('TreeDumper');
goog.require('cvox.ChromeVoxBackground');
goog.require('cvox.ChromeVoxPrefs');
goog.require('cvox.ChromeVoxKbHandler');
goog.require('cvox.ChromeVoxPrefs');
goog.require('cvox.CommandStore');
goog.scope(function() {
var AutomationEvent = chrome.automation.AutomationEvent;
......@@ -25,12 +26,20 @@ var EventType = chrome.automation.EventType;
var RoleType = chrome.automation.RoleType;
var StateType = chrome.automation.StateType;
/** @private {boolean} */
CommandHandler.incognito_ = !!chrome.runtime.getManifest()['incognito'];
/**
* Handles ChromeVox Next commands.
* @param {string} command
* @return {boolean} True if the command should propagate.
*/
CommandHandler.onCommand = function(command) {
// Check for a command disallowed in OOBE/login.
if (CommandHandler.incognito_ && cvox.CommandStore.CMD_WHITELIST[command] &&
cvox.CommandStore.CMD_WHITELIST[command].disallowOOBE)
return true;
// Check for loss of focus which results in us invalidating our current
// range. Note this call is synchronis.
chrome.automation.getFocus(function(focusedNode) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment