Commit 63c8917e authored by Rachel Wong's avatar Rachel Wong Committed by Commit Bot

[omnibox] Set is_answer correctly.

This CL fixes a bug where results are never set to be answers due to
circular logic.

Bug: 1130372
Change-Id: I177dcaaa7a67e23cc31e49ea2f17f1a3ca249fb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437317Reviewed-by: default avatarThanh Nguyen <thanhdng@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Rachel Wong <wrong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812468}
parent 7d7fc6db
......@@ -160,10 +160,12 @@ OmniboxResult::OmniboxResult(Profile* profile,
set_result_subtype(static_cast<int>(match_.type));
SetMetricsType(GetSearchResultType());
if (ShouldDisplayAsAnswer()) {
if (app_list_features::IsOmniboxRichEntitiesEnabled()) {
SetIsAnswer(match_.answer.has_value());
// The answer subtype overrides the match subtype.
set_result_subtype(static_cast<int>(match_.answer->type()));
if (is_answer()) {
// The answer subtype overrides the match subtype.
set_result_subtype(static_cast<int>(match_.answer->type()));
}
}
// Derive relevance from omnibox relevance and normalize it to [0, 1].
......
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