Allow Zero Suggest (on Android) on chrome: and about: Pages
In effect, this fixes this TODO in zero_suggest_provider.cc
// Only show zero suggest for HTTP[S] pages.
// TODO(mariakhomenko): We may be able to expand this set to include pages
// with other schemes (e.g. chrome://). That may require improvements to
// the formatting of the verbatim result returned by MatchForCurrentURL().
As such, the main part of this change is in
components/omnibox/browser/zero_suggest_provider.cc
Everything else in this changelist is simply to get that change working.
I audited all the schemes in the URL constants files.
* Some schemes such as ftp are never used on Android; they're not
supported.
* Some schemes such as chrome-native are used on Android, but they're
never displayed in a context that has an omnibox.
The only ones I found I could get displayed in the omnibox were
about: and chrome:.
For identifying what schemes to investigate, the histogram
Navigation.MainFrameScheme was useful.
This changelist allows zero suggest to appear on those contexts.
Zero suggest still not appear on the new tab page or incognito,
both by product decision. This change does not alter that.
To make this work, I had to make the AutocompleteClient function
GetEmbedderRepresentationOfAboutScheme() const. Most of this
changelist is fixes declarations due to that.
Tested interactively.
TBR=rohitrao
for mechanical changes to ios/c/b/autocomplete
Bug: 704406
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I65be6327d29bd7616e44999304c85317406b67cc
Reviewed-on: https://chromium-review.googlesource.com/1172080
Commit-Queue: Mark Pearson <[email protected]>
Reviewed-by: Justin Donnelly <[email protected]>
Cr-Commit-Position: refs/heads/master@{#586429}
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h
index a2bb163..a6c20378 100644
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h
@@ -47,7 +47,7 @@
std::unique_ptr<KeywordExtensionsDelegate> GetKeywordExtensionsDelegate(
KeywordProvider* keyword_provider) override;
std::string GetAcceptLanguages() const override;
- std::string GetEmbedderRepresentationOfAboutScheme() override;
+ std::string GetEmbedderRepresentationOfAboutScheme() const override;
std::vector<base::string16> GetBuiltinURLs() override;
std::vector<base::string16> GetBuiltinsToProvideAsUserTypes() override;
// GetCurrentVisitTimestamp is only implemented for desktop users. For mobile