| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // See http://dev.chromium.org/developers/design-documents/idn-in-google-chrome | 70 // See http://dev.chromium.org/developers/design-documents/idn-in-google-chrome |
| 71 // for details on the algorithm. | 71 // for details on the algorithm. |
| 72 // | 72 // |
| 73 // - Omits the path for standard schemes, excepting file and filesystem. | 73 // - Omits the path for standard schemes, excepting file and filesystem. |
| 74 // - Omits the port if it is the default for the scheme. | 74 // - Omits the port if it is the default for the scheme. |
| 75 // | 75 // |
| 76 // Do not use this for URLs which will be parsed or sent to other applications. | 76 // Do not use this for URLs which will be parsed or sent to other applications. |
| 77 // | 77 // |
| 78 // Generally, prefer SchemeDisplay::SHOW to omitting the scheme unless there is | 78 // Generally, prefer SchemeDisplay::SHOW to omitting the scheme unless there is |
| 79 // plenty of indication as to whether the origin is secure elsewhere in the UX. | 79 // plenty of indication as to whether the origin is secure elsewhere in the UX. |
| 80 // For example, in Chrome's Origin Info Bubble, there are icons and strings | 80 // For example, in Chrome's Page Info Bubble, there are icons and strings |
| 81 // indicating origin (non-)security. But in the HTTP Basic Auth prompt (for | 81 // indicating origin (non-)security. But in the HTTP Basic Auth prompt (for |
| 82 // example), the scheme may be the only indicator. | 82 // example), the scheme may be the only indicator. |
| 83 base::string16 FormatUrlForSecurityDisplay( | 83 base::string16 FormatUrlForSecurityDisplay( |
| 84 const GURL& origin, | 84 const GURL& origin, |
| 85 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); | 85 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); |
| 86 | 86 |
| 87 // This is a convenience function for formatting a url::Origin in a concise and | 87 // This is a convenience function for formatting a url::Origin in a concise and |
| 88 // human-friendly way, to help users make security-related decisions. | 88 // human-friendly way, to help users make security-related decisions. |
| 89 // | 89 // |
| 90 // - Omits the port if it is 0 or the default for the scheme. | 90 // - Omits the port if it is 0 or the default for the scheme. |
| 91 // | 91 // |
| 92 // Do not use this for origins which will be parsed or sent to other | 92 // Do not use this for origins which will be parsed or sent to other |
| 93 // applications. | 93 // applications. |
| 94 // | 94 // |
| 95 // Generally, prefer SchemeDisplay::SHOW to omitting the scheme unless there is | 95 // Generally, prefer SchemeDisplay::SHOW to omitting the scheme unless there is |
| 96 // plenty of indication as to whether the origin is secure elsewhere in the UX. | 96 // plenty of indication as to whether the origin is secure elsewhere in the UX. |
| 97 base::string16 FormatOriginForSecurityDisplay( | 97 base::string16 FormatOriginForSecurityDisplay( |
| 98 const url::Origin& origin, | 98 const url::Origin& origin, |
| 99 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); | 99 const SchemeDisplay scheme_display = SchemeDisplay::SHOW); |
| 100 | 100 |
| 101 } // namespace url_formatter | 101 } // namespace url_formatter |
| 102 | 102 |
| 103 #endif // COMPONENTS_URL_FORMATTER_ELIDE_URL_H_ | 103 #endif // COMPONENTS_URL_FORMATTER_ELIDE_URL_H_ |
| OLD | NEW |