• Tommy Li's avatar
    [omnibox] Fix a bug with OmniboxPopupModel::TriggerSelectionAction · 1a9e9ccd
    Tommy Li authored
    OmniboxPopupModel::TriggerSelectionAction will definitely crash in the
    no-default-match edge case, which can definitely happen with certain
    enterprise policies.
    
    Additionally, it's possible that UI callers will pass in an invalid
    |selection|, as they are an external class that could potentially be
    stale. In practice, it doesn't SEEM possible for this to occur with
    Views, but I'm not sure.
    
    Philosophically, I think crashing when the UI code gets out of date
    isn't a good thing, and this code should be a bit more tolerant.
    
    Bug: 1085407, 1078183, 1052522
    Change-Id: Ibe5a2b09340679d3bfb86c234bc799f0823fdaaf
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216605Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
    Commit-Queue: Tommy Li <tommycli@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#772420}
    1a9e9ccd
omnibox_popup_model.cc 22.8 KB