#ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_INSTALL_UTILS_H_
#define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_INSTALL_UTILS_H_
#include <string_view>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/containers/flat_set.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/web_app_constants.h"
#include "chrome/browser/web_applications/web_app_icon_operations.h"
#include "chrome/browser/web_applications/web_app_install_finalizer.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "components/services/app_service/public/cpp/file_handler.h"
#include "components/webapps/common/web_app_id.h"
#include "third_party/blink/public/mojom/manifest/manifest.mojom-forward.h"
class GURL;
namespace blink {
namespace mojom {
class Manifest;
}
}
namespace content {
class WebContents;
}
namespace webapps {
enum class WebappInstallSource;
enum class WebappUninstallSource;
}
namespace web_app {
class WebApp;
struct WebAppInstallParams;
enum class ForInstallableSite { … };
DownloadedIconsHttpResults;
DownloadedIconsHttpResults;
void PopulateFileHandlerInfoFromManifest(
const std::vector<blink::mojom::ManifestFileHandlerPtr>&
manifest_file_handlers,
const GURL& app_scope,
WebAppInstallInfo* web_app_info);
void UpdateWebAppInfoFromManifest(const blink::mojom::Manifest& manifest,
WebAppInstallInfo* web_app_info);
WebAppInstallInfo CreateWebAppInfoFromManifest(
const blink::mojom::Manifest& manifest);
void PopulateOtherIcons(WebAppInstallInfo* web_app_info,
const IconsMap& icons_map);
void PopulateProductIcons(WebAppInstallInfo* web_app_info,
const IconsMap* icons_map);
void RecordDownloadedIconsResultAndHttpStatusCodes(
IconsDownloadedResult result,
const DownloadedIconsHttpResults& icons_http_results);
void RecordDownloadedIconsHttpResultsCodeClass(
std::string_view histogram_name,
IconsDownloadedResult result,
const DownloadedIconsHttpResults& icons_http_results);
void RecordDownloadedIconHttpStatusCodes(
std::string_view histogram_name,
const DownloadedIconsHttpResults& icons_http_results);
WebAppManagement::Type ConvertExternalInstallSourceToSource(
ExternalInstallSource external_install_source);
webapps::WebappInstallSource ConvertExternalInstallSourceToInstallSource(
ExternalInstallSource external_install_source);
webapps::WebappUninstallSource ConvertExternalInstallSourceToUninstallSource(
ExternalInstallSource external_install_source);
WebAppManagement::Type ConvertInstallSurfaceToWebAppSource(
webapps::WebappInstallSource install_surface);
void CreateWebAppInstallTabHelpers(content::WebContents* web_contents);
void SetWebAppManifestFields(const WebAppInstallInfo& web_app_info,
WebApp& web_app,
bool skip_icons_on_download_failure = false);
void SetWebAppProductIconFields(const WebAppInstallInfo& web_app_info,
WebApp& web_app);
void ApplyParamsToWebAppInstallInfo(const WebAppInstallParams& install_params,
WebAppInstallInfo& web_app_info);
void ApplyParamsToFinalizeOptions(
const WebAppInstallParams& install_params,
WebAppInstallFinalizer::FinalizeOptions& options);
bool HomeTabIconsExistInTabStrip(const WebAppInstallInfo& web_app_info);
}
#endif