Commit 3cddc841 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Add Learn Mode descriptions for some gestures

See go/chromevox-touch_gestures

Some gestures, e.g. swipe two fingers left, do not have an explicit command. Others, like three finger swipe up/down, have commands which are not also keyboard commands.

In Learn Mode, these gestures are not fullyd escribed beyond just the physical gesture description.

Add these descriptions now in this change.

R=akihiroota@chromium.org

Bug: 1124454
Test: browser_tests --gtest_filter=ChromeVoxLearnMode*.Gesture*
AX-Relnotes: ChromeVox Learn Mode now describes all new gestures and what they do.
Change-Id: I19fd3b39aa15f9df0daa864c4f99f69173d4baa1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386377
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805555}
parent 6d9b2302
......@@ -10,12 +10,16 @@ goog.require('KeyCode');
/**
* Map from gesture names (ax::mojom::Gesture defined in
* ui/accessibility/ax_enums.mojom.) to commands.
*
* Note that only one of |command|, |acceleratorAction|, or |globalKey| is
* expected.
* @type {!Object<string, {msgId: string, command: (string|undefined),
* commandDescriptionMsgId: (string|undefined),
* acceleratorAction:
* (chrome.accessibilityPrivate.AcceleratorAction|undefined),
* globalKey: ({keyCode: KeyCode, modifiers:
* globalKey: ({keyCode: !KeyCode, modifiers:
* (chrome.accessibilityPrivate.SyntheticKeyboardModifiers|undefined)}|undefined),
* menuKeyOverride: ({keyCode: KeyCode, modifiers:
* menuKeyOverride: ({keyCode: !KeyCode, modifiers:
* (chrome.accessibilityPrivate.SyntheticKeyboardModifiers|undefined)}|undefined)}>}
* @const
*/
......@@ -43,21 +47,37 @@ GestureCommandData.GESTURE_COMMAND_MAP = {
},
'swipeUp2': {msgId: 'swipeup2_gesture', command: 'jumpToTop'},
'swipeDown2': {msgId: 'swipedown2_gesture', command: 'readFromHere'},
'swipeLeft2':
{msgId: 'swipeleft2_gesture', globalKey: {keyCode: KeyCode.ESCAPE}},
'swipeRight2':
{msgId: 'swiperight2_gesture', globalKey: {keyCode: KeyCode.RETURN}},
'swipeUp3': {msgId: 'swipeup3_gesture', command: 'nextPage'},
'swipeDown3': {msgId: 'swipedown3_gesture', command: 'previousPage'},
'swipeLeft2': {
msgId: 'swipeleft2_gesture',
commandDescriptionMsgId: 'escape_gesture_description',
globalKey: {keyCode: KeyCode.ESCAPE}
},
'swipeRight2': {
msgId: 'swiperight2_gesture',
commandDescriptionMsgId: 'enter_gesture_description',
globalKey: {keyCode: KeyCode.RETURN}
},
'swipeUp3': {
msgId: 'swipeup3_gesture',
commandDescriptionMsgId: 'next_page_gesture_description',
command: 'nextPage'
},
'swipeDown3': {
msgId: 'swipedown3_gesture',
commandDescriptionMsgId: 'previous_page_gesture_description',
command: 'previousPage'
},
'swipeLeft3': {msgId: 'swipeleft3_gesture', command: 'previousGranularity'},
'swipeRight3': {msgId: 'swiperight3_gesture', command: 'nextGranularity'},
'swipeLeft4': {
msgId: 'swipeleft4_gesture',
commandDescriptionMsgId: 'previous_pane_gesture_description',
acceleratorAction:
chrome.accessibilityPrivate.AcceleratorAction.FOCUS_PREVIOUS_PANE
},
'swipeRight4': {
msgId: 'swiperight4_gesture',
commandDescriptionMsgId: 'next_pane_gesture_description',
acceleratorAction:
chrome.accessibilityPrivate.AcceleratorAction.FOCUS_NEXT_PANE
},
......
......@@ -230,6 +230,9 @@ KbExplorer = class {
if (gestureData.command) {
KbExplorer.onCommand(gestureData.command);
}
if (gestureData.commandDescriptionMsgId) {
KbExplorer.output(Msgs.getMsg(gestureData.commandDescriptionMsgId));
}
}
}
......
......@@ -148,6 +148,11 @@ TEST_F('ChromeVoxLearnModeTest', 'Gesture', function() {
.call(doGesture('touchExplore'))
.expectSpeechWithQueueMode('Touch explore', QueueMode.FLUSH)
// Test for inclusion of commandDescriptionMsgId when provided.
.call(doGesture('swipeLeft2'))
.expectSpeechWithQueueMode('Swipe two fingers left', QueueMode.FLUSH)
.expectSpeechWithQueueMode('Escape', QueueMode.QUEUE)
.replay();
});
});
......
......@@ -3002,5 +3002,23 @@
<message desc="Describes a table header sorted in descending order. No associated UI with this string which is spoken using text-to-speech." name="IDS_CHROMEVOX_SORT_DESCENDING" is_accessibility_with_no_ui="true">
Descending sort
</message>
<message desc="Describes scrolling up by a page using a gesture. No associated UI with this string which is spoken using text-to-speech." name="IDS_CHROMEVOX_PREVIOUS_PAGE_GESTURE_DESCRIPTION" is_accessibility_with_no_ui="true">
Scroll to previous page
</message>
<message desc="Describes scrolling down by a page using a gesture. No associated UI with this string which is spoken using text-to-speech." name="IDS_CHROMEVOX_NEXT_PAGE_GESTURE_DESCRIPTION" is_accessibility_with_no_ui="true">
Scroll to next page
</message>
<message desc="Describes gesture that simulates pressing the escape key. No associated UI with this string which is spoken using text-to-speech." name="IDS_CHROMEVOX_ESCAPE_GESTURE_DESCRIPTION" is_accessibility_with_no_ui="true">
Escape
</message>
<message desc="Describes gesture that simulates pressing the enter key. No associated UI with this string which is spoken using text-to-speech." name="IDS_CHROMEVOX_ENTER_GESTURE_DESCRIPTION" is_accessibility_with_no_ui="true">
Enter
</message>
<message desc="Describes gesture that movees to the previous important section on the screen (e.g. the Launcher, Status Tray, etc). No associated UI with this string which is spoken using text-to-speech." name="IDS_CHROMEVOX_PREVIOUS_PANE_GESTURE_DESCRIPTION" is_accessibility_with_no_ui="true">
Move to previous section. Examples include the Status Tray and Launcher.
</message>
<message desc="Describes gesture that movees to the next important section on the screen (e.g. the Launcher, Status Tray, etc). No associated UI with this string which is spoken using text-to-speech." name="IDS_CHROMEVOX_NEXT_PANE_GESTURE_DESCRIPTION" is_accessibility_with_no_ui="true">
Move to next section. Examples include the Status Tray and Launcher.
</message>
</grit-part>
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