Commit e7f01345 authored by Tommy Li's avatar Tommy Li Committed by Commit Bot

[omnibox] Add a supporting comment to OnUpOrDownKeyPressed fix

CL is just adding some documentation to mahmadi's fix.

Also swaps the conditional a bit to match the comment.

Bug: 996516
Change-Id: Id69caa88bf8a243d0ffdc552c19d87080677df1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849042Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704643}
parent b405097b
......@@ -1178,8 +1178,12 @@ void OmniboxEditModel::OnUpOrDownKeyPressed(int count) {
// If, as a result of the key press, we would select the first result, then
// we should revert the temporary text same as what pressing escape would
// have done.
//
// This doesn't apply for on-focus suggestions, for which the first result
// can be completely distinct from the omnibox contents. We enforce that
// via user_input_in_progress_, which is false for ZeroSuggest.
const size_t line_no = GetNewSelectedLine(count);
if (has_temporary_text_ && user_input_in_progress_ && line_no == 0) {
if (has_temporary_text_ && line_no == 0 && user_input_in_progress_) {
RevertTemporaryText(true);
} else {
popup_model()->MoveTo(line_no);
......
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