The fix for (crashing) bug 869384 introduces a new OmniboxClient function: IsDefaultSearchProviderEnabled().
We should use this in search_provider.cc, keyword_provider.cc, and related places.
https://cs.chromium.org/search/?q=GetDefaultSearchProvider+file:omnibox&sq=package:chromium&type=cs
Currently, the code sometimes uses null checks and sometimes doesn't bother.
Notably, I wouldn't be surprised if we still have edge case crashes in here.
We also apparently implicitly have some logic that's wrong; it assumes that if the user has a default provider, it's okay to provide suggestions even if the provider is disabled by policy. I believe the "disabled by policy" flag is independent of whether the user actually has or doesn't have a default provider set. (Obviously, it should be used if it's disabled...)
Comment 1 by nicolaso@chromium.org
, Aug 7