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

Unified Diff: chrome/browser/autocomplete/history_url_provider.cc

Issue 8286011: When users navigate to an intranet host that has not been previously typed, treat it as a typed n... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « no previous file | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/history_url_provider.cc
===================================================================
--- chrome/browser/autocomplete/history_url_provider.cc (revision 105368)
+++ chrome/browser/autocomplete/history_url_provider.cc (working copy)
@@ -400,7 +400,7 @@
// for more results than we need, of every prefix type, in hopes this will
// give us far more than enough to work with. CullRedirects() will then
// reduce the list to the best kMaxMatches results.
- db->AutocompleteForPrefix(i->prefix + params->input.text(),
+ db->AutocompleteForPrefix(UTF16ToUTF8(i->prefix + params->input.text()),
kMaxMatches * 2, (backend == NULL), &url_matches);
for (URLRowVector::const_iterator j(url_matches.begin());
j != url_matches.end(); ++j) {
@@ -750,22 +750,11 @@
!LowerCaseEqualsASCII(input.scheme(), chrome::kHttpScheme) ||
!input.parts().host.is_nonempty())
return false;
- const string16 host(input.text().substr(input.parts().host.begin,
- input.parts().host.len));
- if (net::RegistryControlledDomainService::GetRegistryLength(
- UTF16ToUTF8(host), false) != 0)
+ const std::string host(UTF16ToUTF8(
+ input.text().substr(input.parts().host.begin, input.parts().host.len)));
+ if (net::RegistryControlledDomainService::GetRegistryLength(host, false) != 0)
return false;
- std::vector<history::URLRow> dummy;
- for (history::Prefixes::const_iterator i(prefixes_.begin());
- i != prefixes_.end(); ++i) {
- if ((i->num_components == 1) &&
- (db->AutocompleteForPrefix(i->prefix + host + ASCIIToUTF16("/"), 1,
- true, &dummy) ||
- db->AutocompleteForPrefix(i->prefix + host + ASCIIToUTF16(":"), 1,
- true, &dummy)))
- return true;
- }
- return false;
+ return db->IsTypedHost(host);
}
bool HistoryURLProvider::PromoteMatchForInlineAutocomplete(
« no previous file with comments | « no previous file | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698