• mpearson's avatar
    Omnibox: Make HUP Scoring Saner in Prevent-Inline Mode · b457e328
    mpearson authored
    In particular, make HistoryURL provider scoring
    basically the same within regular mode and
    prevent-inline-autocomplete mode (under the constraint
    that we always need a valid default match first).
    For what it's worth, the current code demotes (from
    ~1410) all non-URL-what-you-typed URLs (non-UWYT)
    to 900 in prevent-inline-autocomplete mode.  If
    there is a UWYT, though, these results will be
    clustered / given a free ride to appear right
    below it, scoring ~1200.  After this change, all
    non-UWYT results will score the same in
    prevent-inline-autocomplete and normal modes.
    We instead rely on the allowed_to_be_default_match
    bit to reorder results as necessary.
    
    To implement this feature, we need knowledge of
    whether the what-you-typed match is reasonable.
    This change re-adds a variable
    have_what_you_typed_match to HistoryURLParams.  This
    variable was previously added in
    https://codereview.chromium.org/347963002 for
    a field trial and then later removed in
    https://codereview.chromium.org/879053002
    
    With this variable, the change is straightforward.
    Don't change the scoring in prevent-inline-autocomplete
    mode.  Instead, simply make sure the what-you-type
    match gets added to the list in prevent-inline-mode.
    We add it early on the list (using the Promote()
    mechanism) so that it'll always appear in the final
    set of suggestions.
    
    Tested using about:omnibox
    
    BUG=421772
    
    Review URL: https://codereview.chromium.org/1022643002
    
    Cr-Commit-Position: refs/heads/master@{#322528}
    b457e328
history_url_provider.h 15.7 KB