Commit 5383060a authored by Anastasia Helfinstein's avatar Anastasia Helfinstein Committed by Commit Bot

[Switch Access] Move cut/copy/paste implementations into node

This is a step towards incorporating Rose and Sophie's code (see links
below) for text navigation and selection from last summer into the
new navigation paradigm.

Ex: https://chromium-review.googlesource.com/c/chromium/src/+/1772301
https://chromium-review.googlesource.com/c/chromium/src/+/1727242

Bug: 982004
Change-Id: I9a3c9e86dfdf15c3cdaea0086f64273192c06491
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076445
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746625}
parent 33303bce
...@@ -519,15 +519,6 @@ class MenuManager { ...@@ -519,15 +519,6 @@ class MenuManager {
case SAConstants.MenuAction.MOVE_UP_ONE_LINE_OF_TEXT: case SAConstants.MenuAction.MOVE_UP_ONE_LINE_OF_TEXT:
TextNavigationManager.moveUpOneLine(); TextNavigationManager.moveUpOneLine();
return; return;
case SAConstants.MenuAction.CUT:
EventHelper.simulateKeyPress(EventHelper.KeyCode.X, {ctrl: true});
return;
case SAConstants.MenuAction.COPY:
EventHelper.simulateKeyPress(EventHelper.KeyCode.C, {ctrl: true});
return;
case SAConstants.MenuAction.PASTE:
EventHelper.simulateKeyPress(EventHelper.KeyCode.V, {ctrl: true});
return;
case SAConstants.MenuAction.SELECT_START: case SAConstants.MenuAction.SELECT_START:
TextNavigationManager.saveSelectStart(); TextNavigationManager.saveSelectStart();
if (this.menuOriginNode_) { if (this.menuOriginNode_) {
......
...@@ -60,6 +60,15 @@ class EditableTextNode extends NodeWrapper { ...@@ -60,6 +60,15 @@ class EditableTextNode extends NodeWrapper {
case SAConstants.MenuAction.DICTATION: case SAConstants.MenuAction.DICTATION:
chrome.accessibilityPrivate.toggleDictation(); chrome.accessibilityPrivate.toggleDictation();
return SAConstants.ActionResponse.CLOSE_MENU; return SAConstants.ActionResponse.CLOSE_MENU;
case SAConstants.MenuAction.CUT:
EventHelper.simulateKeyPress(EventHelper.KeyCode.X, {ctrl: true});
return SAConstants.ActionResponse.REMAIN_OPEN;
case SAConstants.MenuAction.COPY:
EventHelper.simulateKeyPress(EventHelper.KeyCode.C, {ctrl: true});
return SAConstants.ActionResponse.REMAIN_OPEN;
case SAConstants.MenuAction.PASTE:
EventHelper.simulateKeyPress(EventHelper.KeyCode.V, {ctrl: true});
return SAConstants.ActionResponse.REMAIN_OPEN;
} }
return super.performAction(action); return super.performAction(action);
} }
......
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