Omnibox: Prevent ctrl-enter behavior when we believe the ctrl key was pressed...
Omnibox: Prevent ctrl-enter behavior when we believe the ctrl key was pressed in order to perform another action. For example, if the user presses ctrl-a to select all the text in the omnibox, then presses enter without releasing ctrl, we do not perform ctrl-enter behavior. On the other hand, if the user releases and represses ctrl after performing a ctrl action, we do perform ctrl-enter behavior. This cl does two changes for the above goal. 1. Previously, ctrl-enter was disabled when the omnibox is focused via ctrl-l but not when the omnibox was already focused and the user presses ctrl-l. Now, we disable ctrl-enter in both cases. 2. Previously, ctrl-enter was disabled if a ctrl action caused either the omnibox selection or text to change; e.g. ctrl-v when the clipboard is non-empty causes a text change, and ctrl-a when the omnibox is non-empty causes a selection change. However, ctrl-enter was not disabled if the ctrl-action did not cause a selction or text change; e.g. ctrl-c, ctrl-v when the clipboard is empty, ctrl-a when the entire omnibox text is already selected, ctrl-left when no omnibox text is selected, etc. Now we disable ctrl-enter if an action was executed, regardless of whether that action caused the omnibox text or selection to change. For example, if text selection is not empty, ctrl-c will disable ctrl-enter, but if selection is empty, ctrl-c will not disable ctrl-enter. Ctrl-left/right/home/end are the 1 notable exception, where they will disable ctrl-enter regardless of whether the cursor was already at either edge. Bug: 75715 Change-Id: I8b2b4829697bf66855879366e4429494c3e95ab9 Reviewed-on: https://chromium-review.googlesource.com/1173424 Commit-Queue: manuk hovanesian <manukh@chromium.org> Reviewed-by:Tommy Li <tommycli@chromium.org> Cr-Commit-Position: refs/heads/master@{#583640}
Showing
Please register or sign in to comment