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 |
11 // be insecure and insufficient to make comparisons solely on formatted URLs | 11 // be insecure and insufficient to make comparisons solely on formatted URLs |
12 // (that is, it should not be used for normalizing URLs for comparison for | 12 // (that is, it should not be used for normalizing URLs for comparison for |
13 // security decisions). | 13 // security decisions). |
14 | 14 |
15 #ifndef COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ | 15 #ifndef COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ |
16 #define COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ | 16 #define COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ |
17 | 17 |
| 18 #include <stddef.h> |
18 #include <stdint.h> | 19 #include <stdint.h> |
19 | 20 |
20 #include <string> | 21 #include <string> |
21 #include <vector> | 22 #include <vector> |
22 | 23 |
23 #include "base/strings/string16.h" | 24 #include "base/strings/string16.h" |
24 #include "base/strings/utf_offset_string_conversions.h" | 25 #include "base/strings/utf_offset_string_conversions.h" |
25 #include "net/base/escape.h" | 26 #include "net/base/escape.h" |
26 | 27 |
27 class GURL; | 28 class GURL; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // If |text| starts with "www." it is removed, otherwise |text| is returned | 154 // If |text| starts with "www." it is removed, otherwise |text| is returned |
154 // unmodified. | 155 // unmodified. |
155 base::string16 StripWWW(const base::string16& text); | 156 base::string16 StripWWW(const base::string16& text); |
156 | 157 |
157 // Runs |url|'s host through StripWWW(). |url| must be valid. | 158 // Runs |url|'s host through StripWWW(). |url| must be valid. |
158 base::string16 StripWWWFromHost(const GURL& url); | 159 base::string16 StripWWWFromHost(const GURL& url); |
159 | 160 |
160 } // namespace url_formatter | 161 } // namespace url_formatter |
161 | 162 |
162 #endif // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ | 163 #endif // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ |
OLD | NEW |