Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc

Issue 2947643002: [ios] Enables the BuiltinProvider. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/omnibox/browser/autocomplete_classifier.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc
diff --git a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc
index 345b7a2d7a6309804c8efc78c290133eead9fca6..4a08d63899ce59e33124205255ce9e5f2f450230 100644
--- a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc
+++ b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc
@@ -119,14 +119,24 @@ AutocompleteProviderClientImpl::GetEmbedderRepresentationOfAboutScheme() {
}
std::vector<base::string16> AutocompleteProviderClientImpl::GetBuiltinURLs() {
Peter Kasting 2017/06/19 21:00:43 It looks like these two functions are basically co
rohitrao (ping after 24h) 2017/06/20 12:08:20 The Client interfaces exist to allow for embedder-
Justin Donnelly 2017/06/20 15:16:39 I had the same reaction as Peter (ugh, duplication
Peter Kasting 2017/06/21 01:10:15 Is there any reason not to just change the API to
rohitrao (ping after 24h) 2017/06/21 15:15:35 I'll send this out as a followup; we can look at t
- // iOS does not supports BuiltinProvider.
- return std::vector<base::string16>();
+ std::vector<std::string> chrome_builtins(
+ kChromeHostURLs,
+ kChromeHostURLs + kNumberOfChromeHostURLs);
+ std::sort(chrome_builtins.begin(), chrome_builtins.end());
+
+ std::vector<base::string16> builtins;
+ for (std::vector<std::string>::iterator i(chrome_builtins.begin());
Peter Kasting 2017/06/19 21:00:43 Nit: Range-based for can help here
rohitrao (ping after 24h) 2017/06/20 12:08:20 Done.
+ i != chrome_builtins.end(); ++i)
+ builtins.push_back(base::ASCIIToUTF16(*i));
+ return builtins;
}
std::vector<base::string16>
AutocompleteProviderClientImpl::GetBuiltinsToProvideAsUserTypes() {
- // iOS does not supports BuiltinProvider.
- return std::vector<base::string16>();
+ std::vector<base::string16> builtins_to_provide;
+ builtins_to_provide.push_back(base::ASCIIToUTF16(kChromeUIChromeURLsURL));
+ builtins_to_provide.push_back(base::ASCIIToUTF16(kChromeUIVersionURL));
+ return builtins_to_provide;
Peter Kasting 2017/06/19 21:00:43 Nit: I bet you could just do: return {base::ASC
rohitrao (ping after 24h) 2017/06/20 12:08:20 Done.
}
bool AutocompleteProviderClientImpl::IsOffTheRecord() const {
« no previous file with comments | « components/omnibox/browser/autocomplete_classifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698