Skip to content

Commit

Permalink
[omnibox] Remove ChromeOS/NTP exception case w/ MaybeCullTailSuggestions
Browse files Browse the repository at this point in the history
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: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715414}
  • Loading branch information
Tommy Li authored and Commit Bot committed Nov 14, 2019
1 parent 92a765e commit 42df412
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions components/omnibox/browser/autocomplete_result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down

0 comments on commit 42df412

Please sign in to comment.