• Tommy C. Li's avatar
    Omnibox UI: Don't use the display URL to generate matches · f9115e6c
    Tommy C. Li authored
    Previously, when the autocomplete engine did not provide any matches,
    the OmniboxEditModel would generate a current match from the text
    contents of the View.
    
    This would lead to bad behavior when Steady State Elisions was on. For
    example, if the user was at the full URL https://router/, and the
    elided display text was simply "router", this would trigger a search
    when the user pressed Ctrl+L, and then Enter.
    
    This CL fixes that by only using the View text if user input is in
    progress, and using the full formatted URL otherwise (if in display
    mode).
    
    This bug doesn't have an impact unless the Steady State Elisions flag
    is on, so this doesn't require a merge.
    
    This CL also adds a test.
    
    Bug: 797354
    Change-Id: Id27913f567313333e8a171a8040bf906a7a1cc52
    Reviewed-on: https://chromium-review.googlesource.com/1013694Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Commit-Queue: Tommy Li <tommycli@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#551509}
    f9115e6c
omnibox_edit_model.cc 63.9 KB