• manukh's avatar
    [omnibox] [rich-autocompletion] Clear additional text on popup close. · b5759239
    manukh authored
    Closing the omnibox popup can change the selected suggestion. This
    occurs in 3 cases:
    
    1) Search what you type suggestions that look like URLs. E.g. after
    selecting the search-what-you-typed suggestion 'x.com' and closing the
    popup, the omnibox will navigate to 'x.com' instead of searching the
    default search engine for 'x.com'
    
    2) Title autocompletions for inputs that look like searches. E.g., for
    the suggestion 'jupiter - wi[kipedia]', after closing the popup, the
    omnibox will display 'jupiter - wikipedia (wikipedia.org/wiki/Jupiter)'
    but will search for 'jupiter - wikipedia' instead of navigating to
    'wikipedia.org/wiki/Jupiter'.
    
    3) Title autocompletions for inputs that look like a different URL than
    their URLs. E.g., for a bookmark titled 'x.com' with URL 'y.com', after
    closing the popup, the omnibox will display 'x.com (y.com)' but actually
    navigate to 'x.com' instead of 'y.com'.
    
    The first case isn't problematic, because closing the popup updates the
    omnibox favicon, and there's no additional text. Cases 2 and 3 are
    problematic because the additional text from before closing the omnibox
    no longer represents where the omnibox will actually navigate to after
    closing the omnibox. This CL addresses this by clearing the additional
    text when closing the popup.
    
    Perhaps the preferred long-term solution would be to prevent the
    selected suggestion from changing when closing the popup. But for the
    time being, this CL at least updates the view to correspond to the
    updated suggestion.
    
    Bug: 1062446
    Change-Id: If5c4ef25abbd73d54540eeb8cb5b85b4db307107
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628011Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
    Commit-Queue: manuk hovanesian <manukh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#845346}
    b5759239
omnibox_edit_model.h 30 KB