Commit 23e3b478 authored by manuk's avatar manuk Committed by Commit Bot

[Omnibox] Open suggestion in background tab on alt+shift enter.

Currently, we opened suggestions in a background tab when holding the
super (Linux) or command (Mac) keys and pressing enter. The code implies
pressing the window key and pressing enter should behave likewise on
Windows; but this didn't work because key presses aren't propagated when
the window key is held down.

With this CL, holding alt+shift and pressing enter behaves similarly.
This
1) brings feature parity to Windows, and
2) is symmetric to alt+enter which opens the suggestion in a new
foreground tab.

Bug: 898277
Change-Id: Ia6423435e9a3c9de81746ceda266803cad18704c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1937687
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719398}
parent b6cac9c3
......@@ -1576,10 +1576,10 @@ bool OmniboxViewViews::HandleKeyEvent(views::Textfield* textfield,
case ui::VKEY_RETURN:
if (MaybeTriggerSecondaryButton(event)) {
return true;
} else if (alt || (shift && command)) {
} else if ((alt && !shift) || (shift && command)) {
model()->AcceptInput(WindowOpenDisposition::NEW_FOREGROUND_TAB,
event.time_stamp());
} else if (command) {
} else if (alt || command) {
model()->AcceptInput(WindowOpenDisposition::NEW_BACKGROUND_TAB,
event.time_stamp());
} else if (shift) {
......
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