applist-focus: Make SearchBoxTextfield listen to key event any time
Changes: 1. Override OnKeyEvent in AppListView and SearchBoxView to redirect key event to SearchBoxTextfield through Textfield::InsertChar() and Textfield::OnKeyEvent(). 2. Make SearchBoxTextfield focused when query changes in SearchBoxView::ContentsChanged or key event is handled by Textfield::OnKeyEvent(). 3. Add a SetFirstResultSelected() in SearchResultContainerView to set a fake focus (highlight background) on first search result whenever query is updated. Hitting enter when SearchBoxTextfield is focued opens the first search result. 4. Add test coverage: a. Type query when focus is on close button, suggestion app, expand arrow. b. First result is selected when query updated. c. Hitting Enter when search box is focused opens the first result. Design doc: go/applist-focus BUG=767996 TEST=AppListViewFocusTest Change-Id: I5e523c4d2d392b888d8029043dab843010031080 Reviewed-on: https://chromium-review.googlesource.com/679157Reviewed-by:Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Weidong Guo <weidongg@chromium.org> Cr-Commit-Position: refs/heads/master@{#504159}
Showing
Please register or sign in to comment