Chromium Code Reviews| Index: components/url_formatter/elide_url.h |
| diff --git a/components/url_formatter/elide_url.h b/components/url_formatter/elide_url.h |
| index 60a513116a534dd754ea4e494ec95ec0e528c28e..4c4cbb3168d94dabf23210df43716af82e9eefe3 100644 |
| --- a/components/url_formatter/elide_url.h |
| +++ b/components/url_formatter/elide_url.h |
| @@ -48,6 +48,12 @@ base::string16 ElideHost(const GURL& host_url, |
| float available_pixel_width); |
| #endif // !defined(OS_ANDROID) |
| +enum class SchemeDisplay { |
| + SHOW, |
| + OMIT_WEB, |
| + OMIT_CRYPTOGRAPHIC, |
| +}; |
| + |
| // 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 |
| // other circumstances when people need to distinguish sites, origins, or |
| @@ -62,18 +68,14 @@ base::string16 ElideHost(const GURL& host_url, |
| // |
| // Do not use this for URLs which will be parsed or sent to other applications. |
| // |
| -// Generally, set prefer this function to |
| -// |FormatUrlForSecurityDisplayOmitScheme| unless there is plenty of indication |
| -// as to whether the origin is secure elsewhere in the UX. For example, in |
| -// Chrome's Origin Info Bubble, there are icons and strings indicating origin |
| -// (non-)security. But in the HTTP Basic Auth prompt (for example), the scheme |
| -// may be the only indicator. |
| -base::string16 FormatUrlForSecurityDisplay(const GURL& origin); |
| - |
| -// Just like |FormatUrlForSecurityDisplay|, but also: |
| -// |
| -// - Omits the scheme if SchemeIsHTTPOrHTTPS(). |
| -base::string16 FormatUrlForSecurityDisplayOmitScheme(const GURL& origin); |
| +// Generally, set prefer SchemeDisplay::SHOW to omitting the scheme unless there |
|
palmer
2016/04/15 00:53:29
Typo in my original test: remove "set".
benwells
2016/04/18 00:53:05
Done.
|
| +// is plenty of indication as to whether the origin is secure elsewhere in the |
| +// UX. For example, in Chrome's Origin Info Bubble, there are icons and strings |
| +// indicating origin (non-)security. But in the HTTP Basic Auth prompt (for |
| +// example), the scheme may be the only indicator. |
| +base::string16 FormatUrlForSecurityDisplay( |
| + const GURL& origin, |
| + const SchemeDisplay scheme_display = SchemeDisplay::SHOW); |
| } // namespace url_formatter |