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

Unified Diff: components/url_formatter/url_formatter.h

Issue 1258813002: Implement a new IDN display policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more comment update per Peter Created 4 years, 9 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
Index: components/url_formatter/url_formatter.h
diff --git a/components/url_formatter/url_formatter.h b/components/url_formatter/url_formatter.h
index ddf40985f659e42e0ca2d8b5740266f08add6f47..d460ba0e681874fd1903572313e5112e52bc1751 100644
--- a/components/url_formatter/url_formatter.h
+++ b/components/url_formatter/url_formatter.h
@@ -53,8 +53,9 @@ extern const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname;
// Convenience for omitting all unecessary types.
extern const FormatUrlType kFormatUrlOmitAll;
-// Creates a string representation of |url|. The IDN host name may be in Unicode
-// if |languages| accepts the Unicode representation. |format_type| is a bitmask
+// Creates a string representation of |url|. The IDN host name is turned to
+// Unicode if the Unicode representation is deemed safe. |languages| is not
+// used any more and will be removed. |format_type| is a bitmask
// of FormatUrlTypes, see it for details. |unescape_rules| defines how to clean
// the URL for human readability. You will generally want |UnescapeRule::SPACES|
// for display to the user if you can handle spaces, or |UnescapeRule::NORMAL|
@@ -128,7 +129,8 @@ inline base::string16 FormatUrl(const GURL& url, const std::string& languages) {
bool CanStripTrailingSlash(const GURL& url);
// Formats the host in |url| and appends it to |output|. The host formatter
-// takes the same accept languages component as ElideURL().
+// takes the same accept languages component as ElideURL(), but it does not
+// affect the result. It'll be removed.
void AppendFormattedHost(const GURL& url,
const std::string& languages,
base::string16* output);
@@ -139,15 +141,7 @@ void AppendFormattedHost(const GURL& url,
//
// The input should be the canonicalized ASCII host name from GURL. This
// function does NOT accept UTF-8!
-//
-// |languages| is a comma separated list of ISO 639 language codes. It
-// is used to determine whether a hostname is 'comprehensible' to a user
-// who understands languages listed. |host| will be converted to a
-// human-readable form (Unicode) ONLY when each component of |host| is
-// regarded as 'comprehensible'. Scipt-mixing is not allowed except that
-// Latin letters in the ASCII range can be mixed with a limited set of
-// script-language pairs (currently Han, Kana and Hangul for zh,ja and ko).
-// When |languages| is empty, even that mixing is not allowed.
+// |languages| is not used any more and will be removed.
base::string16 IDNToUnicode(const std::string& host,
const std::string& languages);
« no previous file with comments | « components/omnibox/browser/history_url_provider_unittest.cc ('k') | components/url_formatter/url_formatter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698