[omnibox][history-embeddings] Hide loading answers after `Stop()`
The history embeddings answers are allowed to ignore inactivity
`Stop()`s because:
1) Answers are expected to take longer to load than the 1.5s stop timer.
2) Answers are sorted 2nd-to-last above the disclaimer IPH, and changes
lower in the popup are less disruptive than changes higher up.
3) Answers reserve their slot with a 'loading' placeholder, and
replacing the 'loading' placeholder with an answer is less disruptive
than showing a brand new match.
Allowing this stop-exception is delicate. There are 3 `Stop()` scenarios
we need handle:
1) Inactivity `Stop()`
a) User types '@history query'
b) 'loading' answer is displayed
c) 1.5s later the stop timeout triggers causing `Stop()` to be called
d) when the real answer is ready, it replaces the 'loading' answer
2) Popup closure `Stop()`
a) User types '@history query'
b) 'loading' answer is displayed
c) user closes the omnibox causing `Stop()` to be called
d) when the real answer is ready, it should be discarded and not
re-open the closed popup
3) Other `Stop()`
a) User types '@history query'
b) 'loading' answer is displayed
c) user presses the down arrow causing `Stop()` to be called
d) the 'loading' placeholder is removed
e) when the real answer is ready, it shouldn't update the popup
disrupting the user's selection
With this CL, all 3 cases work correctly. But it's still a temporary
solution; see crrev.com/c/5948144 & crrev.com/c/5980091 .
Bug: 364303536, 376329281
Change-Id: I8e1fc96858df999715e636d2f60805f5a3099c47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5998150
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Auto-Submit: manuk hovanesian <manukh@chromium.org>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Reviewed-by: Orin Jaworski <orinj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1379248}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.