Chromium Code Reviews| Index: components/secure_display/elide_url.h |
| diff --git a/chrome/browser/ui/elide_url.h b/components/secure_display/elide_url.h |
| similarity index 68% |
| rename from chrome/browser/ui/elide_url.h |
| rename to components/secure_display/elide_url.h |
| index b68267cb6d23568496f79644ed2e1aed49d80723..48a1e126c15757c6636ef7709ee24ca42ff8afde 100644 |
| --- a/chrome/browser/ui/elide_url.h |
| +++ b/components/secure_display/elide_url.h |
| @@ -4,12 +4,13 @@ |
| // |
| // This file defines utility functions for eliding URLs. |
| -#ifndef CHROME_BROWSER_UI_ELIDE_URL_H_ |
| -#define CHROME_BROWSER_UI_ELIDE_URL_H_ |
| +#ifndef COMPONENTS_SECURE_DISPLAY_ELIDE_URL_H_ |
| +#define COMPONENTS_SECURE_DISPLAY_ELIDE_URL_H_ |
| #include <string> |
| #include "base/strings/string16.h" |
| +#include "components/secure_display/secure_display_export.h" |
| class GURL; |
| @@ -17,6 +18,11 @@ namespace gfx { |
| class FontList; |
| } |
| +namespace secure_display { |
| + |
| +// ElideUrl and Elide host require |
| +// gfx::GetStringWidthF which is not implemented in Android |
| +#if !defined(OS_ANDROID) |
| // This function takes a GURL object and elides it. It returns a string |
| // which composed of parts from subdomain, domain, path, filename and query. |
| // A "..." is added automatically at the end if the elided string is bigger |
| @@ -31,19 +37,20 @@ class FontList; |
| // as an LTR string (using base::i18n::WrapStringWithLTRFormatting()) so that it |
| // is displayed properly in an RTL context. Please refer to |
| // http://crbug.com/6487 for more information. |
| -base::string16 ElideUrl(const GURL& url, |
| - const gfx::FontList& font_list, |
| - float available_pixel_width, |
| - const std::string& languages); |
| +base::string16 SECURE_DISPLAY_EXPORT ElideUrl(const GURL& url, |
| + const gfx::FontList& font_list, |
| + float available_pixel_width, |
| + const std::string& languages); |
| // This function takes a GURL object and elides the host to fit within |
| // the given width. The function will never elide past the TLD+1 point, |
| // but after that, will leading-elide the domain name to fit the width. |
| // Example: http://sub.domain.com ---> "...domain.com", or "...b.domain.com" |
| // depending on the width. |
| -base::string16 ElideHost(const GURL& host_url, |
| - const gfx::FontList& font_list, |
| - float available_pixel_width); |
| +base::string16 SECURE_DISPLAY_EXPORT ElideHost(const GURL& host_url, |
| + const gfx::FontList& font_list, |
| + float available_pixel_width); |
| +#endif |
| // This is a convenience function for formatting a URL in a concise and |
| // human-friendly way, to help users make security-related decisions (or in |
| @@ -58,7 +65,9 @@ base::string16 ElideHost(const GURL& host_url, |
| // - Omits the port if it is the default for the scheme. |
| // |
| // Do not use this for URLs which will be parsed or sent to other applications. |
| -base::string16 FormatUrlForSecurityDisplay(const GURL& origin, |
| - const std::string& languages); |
| +base::string16 SECURE_DISPLAY_EXPORT |
| +FormatUrlForSecurityDisplay(const GURL& origin, const std::string& languages); |
| + |
| +} // namespace |
|
noyau (Ping after 24h)
2015/07/22 09:44:00
nit:
// namespace secure_display
|
| -#endif // CHROME_BROWSER_UI_ELIDE_URL_H_ |
| +#endif // COMPONENTS_SECURE_DISPLAY_ELIDE_URL_H_ |