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

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

Issue 1171333003: Move net::FormatUrl and friends outside of //net and into //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again now that CQ is fixed Created 5 years, 4 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
« no previous file with comments | « components/url_formatter/OWNERS ('k') | components/url_formatter/elide_url.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file defines utility functions for eliding URLs. 5 // This file defines utility functions for eliding URLs.
6 6
7 #ifndef COMPONENTS_SECURE_DISPLAY_ELIDE_URL_H_ 7 #ifndef COMPONENTS_URL_FORMATTER_ELIDE_URL_H_
8 #define COMPONENTS_SECURE_DISPLAY_ELIDE_URL_H_ 8 #define COMPONENTS_URL_FORMATTER_ELIDE_URL_H_
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 13
14 class GURL; 14 class GURL;
15 15
16 namespace gfx { 16 namespace gfx {
17 class FontList; 17 class FontList;
18 } 18 }
19 19
20 namespace secure_display { 20 namespace url_formatter {
21 21
22 // ElideUrl and Elide host require 22 // ElideUrl and Elide host require
23 // gfx::GetStringWidthF which is not implemented in Android 23 // gfx::GetStringWidthF which is not implemented in Android
24 #if !defined(OS_ANDROID) 24 #if !defined(OS_ANDROID)
25 // This function takes a GURL object and elides it. It returns a string 25 // This function takes a GURL object and elides it. It returns a string
26 // which composed of parts from subdomain, domain, path, filename and query. 26 // which composed of parts from subdomain, domain, path, filename and query.
27 // A "..." is added automatically at the end if the elided string is bigger 27 // A "..." is added automatically at the end if the elided string is bigger
28 // than the |available_pixel_width|. For |available_pixel_width| == 0, a 28 // than the |available_pixel_width|. For |available_pixel_width| == 0, a
29 // formatted, but un-elided, string is returned. |languages| is a comma 29 // formatted, but un-elided, string is returned. |languages| is a comma
30 // separated list of ISO 639 language codes and is used to determine what 30 // separated list of ISO 639 language codes and is used to determine what
(...skipping 19 matching lines...) Expand all
50 const gfx::FontList& font_list, 50 const gfx::FontList& font_list,
51 float available_pixel_width); 51 float available_pixel_width);
52 #endif // !defined(OS_ANDROID) 52 #endif // !defined(OS_ANDROID)
53 53
54 // This is a convenience function for formatting a URL in a concise and 54 // This is a convenience function for formatting a URL in a concise and
55 // human-friendly way, to help users make security-related decisions (or in 55 // human-friendly way, to help users make security-related decisions (or in
56 // other circumstances when people need to distinguish sites, origins, or 56 // other circumstances when people need to distinguish sites, origins, or
57 // otherwise-simplified URLs from each other). 57 // otherwise-simplified URLs from each other).
58 // 58 //
59 // Internationalized domain names (IDN) may be presented in Unicode if 59 // Internationalized domain names (IDN) may be presented in Unicode if
60 // |languages| accepts the Unicode representation (see |net::FormatUrl| for more 60 // |languages| accepts the Unicode representation (see
61 // details on the algorithm). 61 // |url_formatter::FormatUrl| for more details on the algorithm).
62 // 62 //
63 // - Omits the path for standard schemes, excepting file and filesystem. 63 // - Omits the path for standard schemes, excepting file and filesystem.
64 // - Omits the port if it is the default for the scheme. 64 // - Omits the port if it is the default for the scheme.
65 // 65 //
66 // Do not use this for URLs which will be parsed or sent to other applications. 66 // Do not use this for URLs which will be parsed or sent to other applications.
67 base::string16 FormatUrlForSecurityDisplay(const GURL& origin, 67 base::string16 FormatUrlForSecurityDisplay(const GURL& origin,
68 const std::string& languages); 68 const std::string& languages);
69 69
70 } // namespace secure_display 70 } // namespace url_formatter
71 71
72 #endif // COMPONENTS_SECURE_DISPLAY_ELIDE_URL_H_ 72 #endif // COMPONENTS_URL_FORMATTER_ELIDE_URL_H_
OLDNEW
« no previous file with comments | « components/url_formatter/OWNERS ('k') | components/url_formatter/elide_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698