Commit be971e55 authored by Tommy Li's avatar Tommy Li Committed by Commit Bot

[omnibox] Enable all default providers for NTP realbox.

When NTP realbox was initially implemented, we didn't use the default
provider list, and instead opted to create a manual whitelist of enabled
providers.

Original CL for context:
https://chromium-review.googlesource.com/c/chromium/src/+/1761688/22/chrome/browser/ui/search/search_tab_helper.cc#558

Now that we are aiming to bring NTP realbox to feature parity with
the actual omnibox, I suggest adopting this two-prong strategy.

 1. Aggressively enable all the same providers in realbox as in the
    omnibox. They should work in principle.

 2. Make NTP realbox work with chrome://omnibox so we can identify and
    fix any weird behavior. See:
    https://bugs.chromium.org/p/chromium/issues/detail?id=1058486

Here's the status on the four newly enabled suggestion types:
 1. On Device Head - seems to work fine.
 2. Document Provider - seems to work fine, although the icons don't
    have the nice custom document icons yet. Not a blocker IMO.
 3. KeywordProvider - I haven't noticed it activate on NTP realbox
    even when enabled. I think since we have forbidden keyword
    operations on AutocompleteInput, it's early exiting. We will need
    to enable chrome://omnibox for NTP realbox to verify this.
 4. Shortcuts - I can't see how this could cause a problem, but again,
    we will need chrome://omnibox to verify its behavior in realbox.

Bug: 1039357
Change-Id: Ibf2b2ec08a8f718c57f3af9456a7457185d67d6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088347Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747806}
parent 185367e7
...@@ -635,16 +635,9 @@ void SearchTabHelper::QueryAutocomplete(const base::string16& input, ...@@ -635,16 +635,9 @@ void SearchTabHelper::QueryAutocomplete(const base::string16& input,
return; return;
if (!autocomplete_controller_) { if (!autocomplete_controller_) {
int providers = AutocompleteProvider::TYPE_BOOKMARK |
AutocompleteProvider::TYPE_BUILTIN |
AutocompleteProvider::TYPE_HISTORY_QUICK |
AutocompleteProvider::TYPE_HISTORY_URL |
AutocompleteProvider::TYPE_SEARCH |
AutocompleteProvider::TYPE_ZERO_SUGGEST |
AutocompleteProvider::TYPE_ZERO_SUGGEST_LOCAL_HISTORY;
autocomplete_controller_ = std::make_unique<AutocompleteController>( autocomplete_controller_ = std::make_unique<AutocompleteController>(
std::make_unique<ChromeAutocompleteProviderClient>(profile()), this, std::make_unique<ChromeAutocompleteProviderClient>(profile()), this,
providers); AutocompleteClassifier::DefaultOmniboxProviders());
} }
if (time_of_first_autocomplete_query_.is_null() && !input.empty()) if (time_of_first_autocomplete_query_.is_null() && !input.empty())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment