Timofey Chudakov | dffeeec7 | 2024-08-30 15:57:28 | [diff] [blame] | 1 | // Copyright 2024 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_UI_UTILS_H_ |
| 6 | #define COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_UI_UTILS_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "components/plus_addresses/plus_address_types.h" |
Luchen Peng | 8552fff | 2025-03-25 16:48:48 | [diff] [blame] | 11 | #include "components/url_formatter/elide_url.h" |
Timofey Chudakov | dffeeec7 | 2024-08-30 15:57:28 | [diff] [blame] | 12 | |
| 13 | namespace plus_addresses { |
| 14 | |
| 15 | // Returns a string for UI display computed from the `plus_address` facet URI. |
| 16 | // For Android origins, the package name is returned. For web origins, the |
| 17 | // formatted URL without the cryptographic scheme is returned. |
Jan Keitel | c643cb8 | 2024-09-10 14:43:33 | [diff] [blame] | 18 | std::u16string GetOriginForDisplay(const PlusProfile& plus_address); |
Timofey Chudakov | dffeeec7 | 2024-08-30 15:57:28 | [diff] [blame] | 19 | |
Luchen Peng | 8552fff | 2025-03-25 16:48:48 | [diff] [blame] | 20 | // Returns a string for UI display computed from the `main_frame_origin`. |
| 21 | // For web origins, the formatted URL without the cryptographic scheme is |
| 22 | // returned. |
| 23 | std::u16string GetOriginForDisplay(const url::Origin& main_frame_origin); |
| 24 | |
Timofey Chudakov | dffeeec7 | 2024-08-30 15:57:28 | [diff] [blame] | 25 | } // namespace plus_addresses |
| 26 | |
| 27 | #endif // COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_UI_UTILS_H_ |