#include "chrome/browser/web_applications/web_app_proto_utils.h"
#include "base/not_fatal_until.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h"
#include "chrome/browser/web_applications/proto/web_app_url_pattern.pb.h"
#include "chrome/browser/web_applications/user_display_mode.h"
#include "components/services/app_service/public/cpp/icon_info.h"
#include "third_party/blink/public/common/manifest/manifest.h"
#include "third_party/blink/public/mojom/manifest/manifest.mojom.h"
#include "third_party/liburlpattern/pattern.h"
#include "ui/gfx/geometry/size.h"
namespace web_app {
namespace {
std::optional<apps::IconInfo::Purpose> SyncPurposeToIconInfoPurpose(
sync_pb::WebAppIconInfo_Purpose purpose) { … }
sync_pb::WebAppIconInfo_Purpose IconInfoPurposeToSyncPurpose(
apps::IconInfo::Purpose purpose) { … }
content::proto::ImageResource_Purpose
ManifestImageResourcePurposeToImageResoucePurposeProto(
blink::mojom::ManifestImageResource_Purpose purpose) { … }
proto::UrlPatternPart::Modifier UrlPatternModifierToProto(
liburlpattern::Modifier modifier) { … }
std::optional<liburlpattern::Modifier> ProtoToUrlPatternModifier(
proto::UrlPatternPart::Modifier modifier) { … }
proto::UrlPatternPart::PartType UrlPatternPartTypeToProto(
liburlpattern::PartType part_type) { … }
std::optional<liburlpattern::PartType> ProtoToUrlPatternPartType(
proto::UrlPatternPart::PartType part_type) { … }
TabStrip::Visibility ProtoToTabStripVisibility(
proto::TabStrip::Visibility visibility) { … }
}
std::optional<std::vector<apps::IconInfo>> ParseAppIconInfos(
const char* container_name_for_logging,
const RepeatedIconInfosProto& manifest_icons_proto) { … }
std::optional<std::vector<blink::Manifest::ImageResource>>
ParseAppImageResource(const char* container_name_for_logging,
const RepeatedImageResourceProto& manifest_icons_proto) { … }
sync_pb::WebAppIconInfo AppIconInfoToSyncProto(
const apps::IconInfo& icon_info) { … }
content::proto::ImageResource AppImageResourceToProto(
const blink::Manifest::ImageResource& image_resource) { … }
RunOnOsLoginMode ToRunOnOsLoginMode(WebAppProto::RunOnOsLoginMode mode) { … }
WebAppProto::RunOnOsLoginMode ToWebAppProtoRunOnOsLoginMode(
RunOnOsLoginMode mode) { … }
std::optional<blink::SafeUrlPattern> ToUrlPattern(
const proto::UrlPattern& proto_url_pattern) { … }
proto::UrlPattern ToUrlPatternProto(const blink::SafeUrlPattern& url_pattern) { … }
std::optional<TabStrip> ProtoToTabStrip(proto::TabStrip tab_strip_proto) { … }
std::string RelativeManifestIdPath(webapps::ManifestId manifest_id) { … }
}