Commit ff5f68e7 authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Fix hardware keyboard entry for the omnibox.

This CL:
https://chromium-review.googlesource.com/c/1331689
overzealously captures all key events instead of the
previous logic that only handled a subset of th expected
navigational keys.  This restricts dispatching to the
list view except for the previously expected keys.

In particular, you can't type space in the current state,
which is...unfortunate.

BUG=898522

Change-Id: I55c055ae6f942cda833f2e3c678a458f55406741
Reviewed-on: https://chromium-review.googlesource.com/c/1336494Reviewed-by: default avatarPedro Amaral <amaralp@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608202}
parent 958f9dd9
......@@ -290,11 +290,14 @@ public class AutocompleteCoordinator implements UrlFocusChangeListener, UrlTextC
*/
public boolean handleKeyEvent(int keyCode, KeyEvent event) {
boolean isShowingList = mListView != null && mListView.isShown();
if (isShowingList && mMediator.getSuggestionCount() > 0
&& (KeyNavigationUtil.isGoDown(event) || KeyNavigationUtil.isGoUp(event))) {
boolean isUpOrDown = KeyNavigationUtil.isGoUpOrDown(event);
if (isShowingList && mMediator.getSuggestionCount() > 0 && isUpOrDown) {
mMediator.allowPendingItemSelection();
}
if (isShowingList && mListView.onKeyDown(keyCode, event)) return true;
boolean isValidListKey = isUpOrDown || KeyNavigationUtil.isGoRight(event)
|| KeyNavigationUtil.isEnter(event);
if (isShowingList && isValidListKey && mListView.onKeyDown(keyCode, event)) return true;
if (KeyNavigationUtil.isEnter(event) && mParent.getVisibility() == View.VISIBLE) {
mMediator.loadTypedOmniboxText(event.getEventTime());
return true;
......
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