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

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

Issue 8510024: Force navigation to non-numeric hostnames with ports (e.g. "abc:81"). This restores the pre-Chro... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete.cc (revision 108344)
+++ chrome/browser/autocomplete/autocomplete.cc (working copy)
@@ -371,8 +371,8 @@
if (NumNonHostComponents(*parts) > 1)
return URL;
- // If the host has a known TLD, it's probably a URL, with the following
- // exceptions:
+ // If the host has a known TLD or a port, it's probably a URL, with the
+ // following exceptions:
// * Any "IP addresses" that make it here are more likely searches
// (see above).
// * If we reach here with a username, our input looks like "user@host[.tld]".
@@ -381,7 +381,8 @@
// default and let users correct us on a case-by-case basis.
// Note that we special-case "localhost" as a known hostname.
if ((host_info.family != url_canon::CanonHostInfo::IPV4) &&
- ((registry_length != 0) || (host == ASCIIToUTF16("localhost"))))
+ ((registry_length != 0) || (host == ASCIIToUTF16("localhost") ||
+ parts->port.is_nonempty())))
return parts->username.is_nonempty() ? UNKNOWN : URL;
// If we reach this point, we know there's no known TLD on the input, so if
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698