Skip to content

Commit

Permalink
[Omnibox] Open suggestion in background tab on alt+shift enter.
Browse files Browse the repository at this point in the history
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: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719398}
  • Loading branch information
manuk authored and Commit Bot committed Nov 26, 2019
1 parent b6cac9c commit 23e3b47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/ui/views/omnibox/omnibox_view_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 23e3b47

Please sign in to comment.