Commit 39d34232 authored by Dana Fried's avatar Dana Fried Committed by Commit Bot

Moving a tab uses CMD key on Mac.

When in keyboard accessibility mode, with a tab keyboard-focused,
pressing CTRL-LEFT or CTRL-RIGHT moves a tab left or right; holding
SHIFT as well moves the tab first or last.

On Mac, since CTRL keys are used to do things like swapping workspaces
we now instead use combinations with the CMD key.

Bug: 996850
Change-Id: I08443c066f6998eb4bfff3fea7ab5be56b005d43
Fixes: 996850
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949205
Auto-Submit: Dana Fried <dfried@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721162}
parent d9336191
......@@ -428,8 +428,14 @@ bool Tab::OnKeyPressed(const ui::KeyEvent& event) {
return true;
}
if (event.type() == ui::ET_KEY_PRESSED &&
(event.flags() & ui::EF_CONTROL_DOWN)) {
constexpr int kModifiedFlag =
#if defined(OS_MACOSX)
ui::EF_COMMAND_DOWN;
#else
ui::EF_CONTROL_DOWN;
#endif
if (event.type() == ui::ET_KEY_PRESSED && (event.flags() & kModifiedFlag)) {
if (event.flags() & ui::EF_SHIFT_DOWN) {
if (event.key_code() == ui::VKEY_RIGHT) {
controller()->MoveTabLast(this);
......
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