blob: 4549a62ead3d5aa9ac8fa8d249cce8de8b840eb6 [file] [log] [blame]
Timofey Chudakovdffeeec72024-08-30 15:57:281// 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 Peng8552fff2025-03-25 16:48:4811#include "components/url_formatter/elide_url.h"
Timofey Chudakovdffeeec72024-08-30 15:57:2812
13namespace 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 Keitelc643cb82024-09-10 14:43:3318std::u16string GetOriginForDisplay(const PlusProfile& plus_address);
Timofey Chudakovdffeeec72024-08-30 15:57:2819
Luchen Peng8552fff2025-03-25 16:48:4820// 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.
23std::u16string GetOriginForDisplay(const url::Origin& main_frame_origin);
24
Timofey Chudakovdffeeec72024-08-30 15:57:2825} // namespace plus_addresses
26
27#endif // COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_UI_UTILS_H_