Commit 6e4034d6 authored by Orin Jaworski's avatar Orin Jaworski Committed by Commit Bot

[omnibox] Attach Pedals after SortAndCull instead of before

If a Pedal attached to a suggestion that later became a duplicate of
an entity suggestion, the Pedal was suppressed. This CL resolves such
cases by waiting until after deduplication (done in SortAndCull) to
attach. This ensures that only root-level suggestions are considered
for Pedals.

Bug: 1126572, 893183
Change-Id: I778ff524b7343304d3f14e79567195080760b298
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401780Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Orin Jaworski <orinj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806367}
parent fe2ca283
...@@ -680,10 +680,6 @@ void AutocompleteController::UpdateResult( ...@@ -680,10 +680,6 @@ void AutocompleteController::UpdateResult(
if (OmniboxFieldTrial::IsTabSwitchSuggestionsEnabled()) if (OmniboxFieldTrial::IsTabSwitchSuggestionsEnabled())
result_.ConvertOpenTabMatches(provider_client_.get(), &input_); result_.ConvertOpenTabMatches(provider_client_.get(), &input_);
if (OmniboxFieldTrial::IsPedalSuggestionsEnabled()) {
result_.ConvertInSuggestionPedalMatches(provider_client_.get());
}
UpdateHeaderInfoFromZeroSuggestProvider(&result_); UpdateHeaderInfoFromZeroSuggestProvider(&result_);
// Sort the matches and trim to a small number of "best" matches. // Sort the matches and trim to a small number of "best" matches.
...@@ -695,6 +691,10 @@ void AutocompleteController::UpdateResult( ...@@ -695,6 +691,10 @@ void AutocompleteController::UpdateResult(
} }
result_.SortAndCull(input_, template_url_service_, preserve_default_match); result_.SortAndCull(input_, template_url_service_, preserve_default_match);
if (OmniboxFieldTrial::IsPedalSuggestionsEnabled()) {
result_.ConvertInSuggestionPedalMatches(provider_client_.get());
}
// Need to validate before invoking CopyOldMatches as the old matches are not // Need to validate before invoking CopyOldMatches as the old matches are not
// valid against the current input. // valid against the current input.
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
......
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