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

Side by Side Diff: components/url_formatter/url_formatter.h

Issue 2966233002: Omnibox UI Experiments: Strip trivial subdomains (Closed)
Patch Set: make cast explicit for windows Created 3 years, 5 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 unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 62 // If the scheme is 'https://', it's removed. Experimental and not in
63 // kFormatUrlOmitAll. 63 // kFormatUrlOmitAll.
64 extern const FormatUrlType kFormatUrlExperimentalOmitHTTPS; 64 extern const FormatUrlType kFormatUrlExperimentalOmitHTTPS;
65 65
66 // Omits some trivially informative subdomains such as "www" or "m".
67 extern const FormatUrlType kFormatUrlExperimentalOmitTrivialSubdomains;
68
66 // Creates a string representation of |url|. The IDN host name is turned to 69 // Creates a string representation of |url|. The IDN host name is turned to
67 // Unicode if the Unicode representation is deemed safe. |format_type| is a 70 // Unicode if the Unicode representation is deemed safe. |format_type| is a
68 // bitmask of FormatUrlTypes, see it for details. |unescape_rules| defines how 71 // bitmask of FormatUrlTypes, see it for details. |unescape_rules| defines how
69 // to clean the URL for human readability. You will generally want 72 // to clean the URL for human readability. You will generally want
70 // |UnescapeRule::SPACES| for display to the user if you can handle spaces, or 73 // |UnescapeRule::SPACES| for display to the user if you can handle spaces, or
71 // |UnescapeRule::NORMAL| if not. If the path part and the query part seem to 74 // |UnescapeRule::NORMAL| if not. If the path part and the query part seem to
72 // be encoded in %-encoded UTF-8, decodes %-encoding and UTF-8. 75 // be encoded in %-encoded UTF-8, decodes %-encoding and UTF-8.
73 // 76 //
74 // The last three parameters may be NULL. 77 // The last three parameters may be NULL.
75 // 78 //
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // If |text| starts with "www." it is removed, otherwise |text| is returned 151 // If |text| starts with "www." it is removed, otherwise |text| is returned
149 // unmodified. 152 // unmodified.
150 base::string16 StripWWW(const base::string16& text); 153 base::string16 StripWWW(const base::string16& text);
151 154
152 // Runs |url|'s host through StripWWW(). |url| must be valid. 155 // Runs |url|'s host through StripWWW(). |url| must be valid.
153 base::string16 StripWWWFromHost(const GURL& url); 156 base::string16 StripWWWFromHost(const GURL& url);
154 157
155 } // namespace url_formatter 158 } // namespace url_formatter
156 159
157 #endif // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_ 160 #endif // COMPONENTS_URL_FORMATTER_URL_FORMATTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698