From 2450c2dc0d0e5335fe6d35a29d5a550b343c5e42 Mon Sep 17 00:00:00 2001 From: "mpearson@chromium.org" Date: Thu, 7 Mar 2013 22:20:09 +0000 Subject: Omnibox: Make Non-Inlineable Results in HQP not Trump Inlineable Ones (for the HUP-like-scoring field trial) BUG=180751 TBR=sky@chromium.org Review URL: https://codereview.chromium.org/12626003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186795 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_field_trial.cc | 2 +- chrome/browser/history/scored_history_match.cc | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chrome/browser/autocomplete/autocomplete_field_trial.cc b/chrome/browser/autocomplete/autocomplete_field_trial.cc index 00643f8..2e1a35d 100644 --- a/chrome/browser/autocomplete/autocomplete_field_trial.cc +++ b/chrome/browser/autocomplete/autocomplete_field_trial.cc @@ -30,7 +30,7 @@ static const char kHUPCullRedirectsFieldTrialName[] = "OmniboxHUPCullRedirects"; static const char kHUPCreateShorterMatchFieldTrialName[] = "OmniboxHUPCreateShorterMatch"; static const char kHQPReplaceHUPScoringFieldTrialName[] = - "OmniboxHQPReplaceHUPHostFix"; + "OmniboxHQPReplaceHUPProhibitTrumpingInlineableResult"; // The autocomplete dynamic field trial name prefix. Each field trial is // configured dynamically and is retrieved automatically by Chrome during diff --git a/chrome/browser/history/scored_history_match.cc b/chrome/browser/history/scored_history_match.cc index c946861..da19490 100644 --- a/chrome/browser/history/scored_history_match.cc +++ b/chrome/browser/history/scored_history_match.cc @@ -221,6 +221,20 @@ ScoredHistoryMatch::ScoredHistoryMatch(const URLRow& row, raw_score = std::min(kMaxTotalScore, raw_score); } + // TODO(mpearson): Refactor this test to use a new member variable + // |max_assigned_score_for_non_inlineable_results|. + // When doing HUP-like scoring, don't allow a non-inlineable result + // to beat the score of good inlineable results. This is a problem + // because if a non-inlineable result ends up with the highest score + // from HistoryQuick provider, all HistoryQuick results get demoted + // to non-inlineable scores (scores less than 1200). This is a + // problem because there are good inlineable results and they should + // appear with their proper scores, not demoted scores. + if (also_do_hup_like_scoring && !can_inline && + (raw_score >= HistoryURLProvider::kScoreForBestInlineableResult)) { + raw_score = HistoryURLProvider::kScoreForBestInlineableResult - 1; + } + if (also_do_hup_like_scoring && can_inline) { // HistoryURL-provider-like scoring gives any result that is // capable of being inlined a certain minimum score. Some of these -- cgit v1.1