| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 // url_formatter contains routines for formatting URLs in a way that can be | 5 // url_formatter contains routines for formatting URLs in a way that can be | 
| 6 // safely and securely displayed to users. For example, it is responsible | 6 // safely and securely displayed to users. For example, it is responsible | 
| 7 // for determining when to convert an IDN A-Label (e.g. "xn--[something]") | 7 // for determining when to convert an IDN A-Label (e.g. "xn--[something]") | 
| 8 // into the IDN U-Label. | 8 // into the IDN U-Label. | 
| 9 // | 9 // | 
| 10 // Note that this formatting is only intended for display purposes; it would | 10 // Note that this formatting is only intended for display purposes; it would | 
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 143 // is used to determine whether a hostname is 'comprehensible' to a user | 143 // is used to determine whether a hostname is 'comprehensible' to a user | 
| 144 // who understands languages listed. |host| will be converted to a | 144 // who understands languages listed. |host| will be converted to a | 
| 145 // human-readable form (Unicode) ONLY when each component of |host| is | 145 // human-readable form (Unicode) ONLY when each component of |host| is | 
| 146 // regarded as 'comprehensible'. Scipt-mixing is not allowed except that | 146 // regarded as 'comprehensible'. Scipt-mixing is not allowed except that | 
| 147 // Latin letters in the ASCII range can be mixed with a limited set of | 147 // Latin letters in the ASCII range can be mixed with a limited set of | 
| 148 // script-language pairs (currently Han, Kana and Hangul for zh,ja and ko). | 148 // script-language pairs (currently Han, Kana and Hangul for zh,ja and ko). | 
| 149 // When |languages| is empty, even that mixing is not allowed. | 149 // When |languages| is empty, even that mixing is not allowed. | 
| 150 base::string16 IDNToUnicode(const std::string& host, | 150 base::string16 IDNToUnicode(const std::string& host, | 
| 151                             const std::string& languages); | 151                             const std::string& languages); | 
| 152 | 152 | 
| 153 // If text starts with "www." it is removed, otherwise text is returned | 153 // If |text| starts with "www." it is removed, otherwise |text| is returned | 
| 154 // unmodified. | 154 // unmodified. | 
| 155 base::string16 StripWWW(const base::string16& text); | 155 base::string16 StripWWW(const base::string16& text); | 
| 156 | 156 | 
| 157 // Runs |url|'s host through StripWWW().  |url| must be valid. | 157 // Runs |url|'s host through StripWWW().  |url| must be valid. | 
| 158 base::string16 StripWWWFromHost(const GURL& url); | 158 base::string16 StripWWWFromHost(const GURL& url); | 
| 159 | 159 | 
| 160 }  // namespace url_formatter | 160 }  // namespace url_formatter | 
| 161 | 161 | 
| 162 #endif  // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ | 162 #endif  // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ | 
| OLD | NEW | 
|---|