summaryrefslogtreecommitdiffstats
path: root/net/base/net_util.h
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 20:05:59 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 20:05:59 +0000
commit7e563816b35dcc102eb69849295b5f6f9d048a63 (patch)
treeb6a833b3b32b58ed8453f1d63682c77d6b158d08 /net/base/net_util.h
parent1679e8667e258a9903a18792894e13a17639e122 (diff)
downloadchromium_src-7e563816b35dcc102eb69849295b5f6f9d048a63.zip
chromium_src-7e563816b35dcc102eb69849295b5f6f9d048a63.tar.gz
chromium_src-7e563816b35dcc102eb69849295b5f6f9d048a63.tar.bz2
Make various types of input work better with ctrl-enter. If we detected that the hostname without adding the TLD was illegal, we'd sometimes fail to allow the TLD to be added.
BUG=38605 TEST=Should be able to hit ctrl-enter on "401k" and "999999999999" to open them with www. and .com attached. Review URL: http://codereview.chromium.org/1088004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.h')
-rw-r--r--net/base/net_util.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/base/net_util.h b/net/base/net_util.h
index 28edad9..f614eb6 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -171,10 +171,15 @@ std::string CanonicalizeHost(const std::wstring& host,
// * Each component contains only alphanumeric characters and '-' or '_'
// * The last component does not begin with a digit
// * Optional trailing dot after last component (means "treat as FQDN")
+// If |desired_tld| is non-NULL, the host will only be considered invalid if
+// appending it as a trailing component still results in an invalid host. This
+// helps us avoid marking as "invalid" user attempts to open "www.401k.com" by
+// typing 4-0-1-k-<ctrl>+<enter>.
//
// NOTE: You should only pass in hosts that have been returned from
// CanonicalizeHost(), or you may not get accurate results.
-bool IsCanonicalizedHostCompliant(const std::string& host);
+bool IsCanonicalizedHostCompliant(const std::string& host,
+ const std::string& desired_tld);
// Call these functions to get the html snippet for a directory listing.
// The return values of both functions are in UTF-8.