Commit 42df4125 authored by Tommy Li's avatar Tommy Li Committed by Commit Bot

[omnibox] Remove ChromeOS/NTP exception case w/ MaybeCullTailSuggestions

Previously, both ChromeOS launcher and NTP ZeroSuggest avoided calling
MaybeCullTailSuggestions. This was because MaybeCullTailSuggestions
did not handle the no-default-match case.

This was fixed here:
https://chromium-review.googlesource.com/c/chromium/src/+/1872485

So this carveout / special case is no longer needed, and in fact, no
longer desirable.

Going forward, we aim to support the no-default-match case as a
first-class citizen in the autocomplete world, so we are working to
eliminate all these special cases in the codebase.

Bug: 1016845, 363656
Change-Id: Ic42bb0d6e114393b03df20cf218a6e328bd197dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913566
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715414}
parent 92a765e3
......@@ -202,18 +202,13 @@ void AutocompleteResult::SortAndCull(
CompareWithDemoteByType<AutocompleteMatch> comparing_object(
input.current_page_classification());
#if !(defined(OS_ANDROID) || defined(OS_IOS))
// Do not cull the tail suggestions for zero prefix query suggetions of
// chromeOS launcher or NTP, since there won't be any default match in this
// scenario.
if (!(input.text().empty() &&
(input.current_page_classification() ==
metrics::OmniboxEventProto::CHROMEOS_APP_LIST ||
BaseSearchProvider::IsNTPPage(input.current_page_classification())))) {
// Wipe tail suggestions if not exclusive (minus default match).
MaybeCullTailSuggestions(&matches_, comparing_object);
}
// Because tail suggestions are a "last resort", we cull the tail suggestions
// if there any non-default non-tail suggestions.
MaybeCullTailSuggestions(&matches_, comparing_object);
#endif
DemoteOnDeviceSearchSuggestions();
DeduplicateMatches(input.current_page_classification(), &matches_);
......
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