• manuk's avatar
    [omnibox] Null check default search provider for shortcut prov and deletion URLs · d202eefd
    manuk authored
    Setting the DefaultSearchProviderEnabled policy to false means
    TemplateURLService::GetDefaultSearchProvider returns null. This CL adds 2 null
    checks for this case.
    
    Firstly, when the user selects a keyword match e.g. 'yahoo.com world', a
    shortcut is created for the input 'world'. If the user then begins typing
    'world', the shortcut provider determines whether the shortcut suggestion
    requires a keyword based on whether it's search engine (yahoo) differs from the
    default search engine (e.g. google). This CL short circuits this check and adds
    the keyword if there is no default search engine.
    
    Secondly, to determine the deletion URL of a search result, the omnibox queries
    the default search engine. This CL skips setting the deletion URL when there is
    no default search engine.
    
    Bug: 871898
    Change-Id: I5b008121c0ce6afd019463070507718ebf86b8dc
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778642
    Commit-Queue: manuk hovanesian <manukh@chromium.org>
    Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#692098}
    d202eefd
base_search_provider.cc 24.6 KB