New issue
Advanced search Search tips

Issue 863156 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Enable shift-enter in Views

Project Member Reported by jdonnelly@chromium.org, Jul 12

Issue description

Today's Cocoa implementation allows users to select an omnibox suggestion and then press shift-enter to open the suggestion in a new window. Views has never supported this but it should, both for utility on all platforms and to avoid regressing this behavior when MacViews launches.

vapier: since you recently added the command-enter behavior (https://crrev.com/c/1132102), could I interest you in taking care of this?
 
i think this request is out of my depth, and requires a bit of discussion first.

there are only three dispositions currently registered everywhere [1]:
  currentTab
  newForegroundTab
  newBackgroundTab

it doesn't sound like reusing any of those is appropriate here.  so we'd need to plumb through "newForegroundWindow" in the JS/C++ code.

i'm guessing you want it to open a new window with one tab by default rather than open a new window with no chrome ?  i.e. you want window.open(chrome=yes) ?

[1] https://developer.chrome.com/extensions/omnibox#type-OnInputEnteredDisposition
Labels: Hotlist-OmniboxKeyboardShortcuts Short

Comment 3 Deleted

Owner: jdonnelly@chromium.org
Status: Started (was: Available)
vapier: I'm not sure what you mean by the dispositions being registered. You're referring, I guess, to the extensions API?

Regardless, just to make sure I knew what's going on, I tried this real quick and using the NEW_WINDOW disposition and it seemed to work fine. Since I already have a bit of code, I'll go ahead and send out a CL.
i guess WindowOpenDisposition::NEW_WINDOW already exists (so the C++ side is done), and omnibox_api.cc has a fallback for unknown dispositions, so simply updating omnibox_view_views.cc doesn't require JS updates (although it'd be nice).  Shift-Enter will continue to trigger currentTab.
Labels: -Pri-2 Pri-3
My CL to enable shift-enter has nearly landed. Reducing priority to P3 for tracking the desire to update the JS to match.
Labels: -OS-Mac
i can roll the JS side if you want
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/135777191e6d978d8e54b5f6cbfadcefe3d3aa49

commit 135777191e6d978d8e54b5f6cbfadcefe3d3aa49
Author: Justin Donnelly <jdonnelly@chromium.org>
Date: Mon Jul 16 14:54:27 2018

[omnibox] Add shift-enter handling to the selected suggestion.

Shift-enter will open the currently selected match in a new window. The
primary purpose of this change is to avoid regressing the existing Cocoa
behavior when MacViews launches. However, it seems just as useful on all
desktop platforms and shift-enter isn't currently in use for anything
else.

Also, remove some dead code that was added to support tab switch back in
https://crrev.com/c/809527. We don't use this shift-enter behavior
anymore so the OnShiftKeyChanged method is no longer needed.

Bug: 863156
Change-Id: I41960db2dd3a81be0ba79db90b2e69a69cf50031
Reviewed-on: https://chromium-review.googlesource.com/1136651
Reviewed-by: Kevin Bailey <krb@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575261}
[modify] https://crrev.com/135777191e6d978d8e54b5f6cbfadcefe3d3aa49/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
[modify] https://crrev.com/135777191e6d978d8e54b5f6cbfadcefe3d3aa49/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
[modify] https://crrev.com/135777191e6d978d8e54b5f6cbfadcefe3d3aa49/components/omnibox/browser/omnibox_view.cc
[modify] https://crrev.com/135777191e6d978d8e54b5f6cbfadcefe3d3aa49/components/omnibox/browser/omnibox_view.h

Owner: vapier@chromium.org
Status: Assigned (was: Started)
Assigning to vapier for handling the JS side of this change. Thanks!
Labels: Group-Omnibox
Labels: -Proj-MdRefresh Proj-DesktopUI
Labels: Hotlist-DesktopUITriaged

Sign in to add a comment