| OLD | NEW |
| 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_URL_FORMATTER_ELIDE_URL_H_ | 7 #ifndef COMPONENTS_URL_FORMATTER_ELIDE_URL_H_ |
| 8 #define COMPONENTS_URL_FORMATTER_ELIDE_URL_H_ | 8 #define COMPONENTS_URL_FORMATTER_ELIDE_URL_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // plenty of indication as to whether the origin is secure elsewhere in the UX. | 77 // plenty of indication as to whether the origin is secure elsewhere in the UX. |
| 78 // For example, in Chrome's Origin Info Bubble, there are icons and strings | 78 // For example, in Chrome's Origin Info Bubble, there are icons and strings |
| 79 // indicating origin (non-)security. But in the HTTP Basic Auth prompt (for | 79 // indicating origin (non-)security. But in the HTTP Basic Auth prompt (for |
| 80 // example), the scheme may be the only indicator. | 80 // example), the scheme may be the only indicator. |
| 81 base::string16 FormatUrlForSecurityDisplay( | 81 base::string16 FormatUrlForSecurityDisplay( |
| 82 const GURL& origin, | 82 const GURL& origin, |
| 83 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); | 83 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); |
| 84 | 84 |
| 85 // This is a convenience function for formatting a url::Origin in a concise and | 85 // This is a convenience function for formatting a url::Origin in a concise and |
| 86 // human-friendly way, to help users make security-related decisions. | 86 // human-friendly way, to help users make security-related decisions. |
| 87 // |
| 88 // - Omits the port if it is 0 or the default for the scheme. |
| 89 // |
| 90 // Do not use this for origins which will be parsed or sent to other |
| 91 // applications. |
| 92 // |
| 93 // Generally, prefer SchemeDisplay::SHOW to omitting the scheme unless there is |
| 94 // plenty of indication as to whether the origin is secure elsewhere in the UX. |
| 87 base::string16 FormatOriginForSecurityDisplay( | 95 base::string16 FormatOriginForSecurityDisplay( |
| 88 const url::Origin& origin, | 96 const url::Origin& origin, |
| 89 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); | 97 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); |
| 90 | 98 |
| 91 } // namespace url_formatter | 99 } // namespace url_formatter |
| 92 | 100 |
| 93 #endif // COMPONENTS_URL_FORMATTER_ELIDE_URL_H_ | 101 #endif // COMPONENTS_URL_FORMATTER_ELIDE_URL_H_ |
| OLD | NEW |