| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 extern const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname; | 52 extern const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname; |
| 53 | 53 |
| 54 // Convenience for omitting all unecessary types. Does not include experimental | 54 // Convenience for omitting all unecessary types. Does not include experimental |
| 55 // flags below. | 55 // flags below. |
| 56 extern const FormatUrlType kFormatUrlOmitAll; | 56 extern const FormatUrlType kFormatUrlOmitAll; |
| 57 | 57 |
| 58 // Replaces the path, query, and ref with an ellipsis. Experimental and not in | 58 // Replaces the path, query, and ref with an ellipsis. Experimental and not in |
| 59 // kFormatUrlOmitAll. | 59 // kFormatUrlOmitAll. |
| 60 extern const FormatUrlType kFormatUrlExperimentalElideAfterHost; | 60 extern const FormatUrlType kFormatUrlExperimentalElideAfterHost; |
| 61 | 61 |
| 62 // If the scheme is 'https://', it's removed. Experimental and not in |
| 63 // kFormatUrlOmitAll. |
| 64 extern const FormatUrlType kFormatUrlExperimentalOmitHTTPS; |
| 65 |
| 62 // Creates a string representation of |url|. The IDN host name is turned to | 66 // Creates a string representation of |url|. The IDN host name is turned to |
| 63 // Unicode if the Unicode representation is deemed safe. |format_type| is a | 67 // Unicode if the Unicode representation is deemed safe. |format_type| is a |
| 64 // bitmask of FormatUrlTypes, see it for details. |unescape_rules| defines how | 68 // bitmask of FormatUrlTypes, see it for details. |unescape_rules| defines how |
| 65 // to clean the URL for human readability. You will generally want | 69 // to clean the URL for human readability. You will generally want |
| 66 // |UnescapeRule::SPACES| for display to the user if you can handle spaces, or | 70 // |UnescapeRule::SPACES| for display to the user if you can handle spaces, or |
| 67 // |UnescapeRule::NORMAL| if not. If the path part and the query part seem to | 71 // |UnescapeRule::NORMAL| if not. If the path part and the query part seem to |
| 68 // be encoded in %-encoded UTF-8, decodes %-encoding and UTF-8. | 72 // be encoded in %-encoded UTF-8, decodes %-encoding and UTF-8. |
| 69 // | 73 // |
| 70 // The last three parameters may be NULL. | 74 // The last three parameters may be NULL. |
| 71 // | 75 // |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // If |text| starts with "www." it is removed, otherwise |text| is returned | 148 // If |text| starts with "www." it is removed, otherwise |text| is returned |
| 145 // unmodified. | 149 // unmodified. |
| 146 base::string16 StripWWW(const base::string16& text); | 150 base::string16 StripWWW(const base::string16& text); |
| 147 | 151 |
| 148 // Runs |url|'s host through StripWWW(). |url| must be valid. | 152 // Runs |url|'s host through StripWWW(). |url| must be valid. |
| 149 base::string16 StripWWWFromHost(const GURL& url); | 153 base::string16 StripWWWFromHost(const GURL& url); |
| 150 | 154 |
| 151 } // namespace url_formatter | 155 } // namespace url_formatter |
| 152 | 156 |
| 153 #endif // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ | 157 #endif // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ |
| OLD | NEW |