#include "components/webapps/browser/installable/installable_evaluator.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "components/security_state/core/security_state.h"
#include "components/webapps/browser/features.h"
#include "components/webapps/browser/webapps_client.h"
#include "components/webapps/common/web_app_id.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "net/base/url_util.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/common/manifest/manifest_util.h"
#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
namespace webapps {
namespace {
IconPurpose;
const int kMinimumPrimaryIconSizeInPx = …;
struct ImageTypeDetails { … };
constexpr ImageTypeDetails kSupportedImageTypes[] = …;
InstallableStatusCode HasManifestOrAtRootScope(
InstallableCriteria criteria,
const blink::mojom::Manifest& manifest,
const GURL& manifest_url,
const GURL& site_url) { … }
bool HasValidStartUrl(const blink::mojom::Manifest& manifest,
const mojom::WebPageMetadata& metadata,
const GURL& site_url,
InstallableCriteria criteria) { … }
bool IsManifestNameValid(const blink::mojom::Manifest& manifest) { … }
bool IsWebPageMetadataContainValidName(const mojom::WebPageMetadata& metadata) { … }
bool HasValidName(const blink::mojom::Manifest& manifest,
const mojom::WebPageMetadata& metadata,
InstallableCriteria criteria) { … }
bool IsIconTypeSupported(const blink::Manifest::ImageResource& icon) { … }
bool DoesManifestContainRequiredIcon(const blink::mojom::Manifest& manifest) { … }
bool HasNonDefaultFavicon(content::WebContents* web_contents) { … }
bool HasValidIcon(content::WebContents* web_contents,
const blink::mojom::Manifest& manifest,
InstallableCriteria criteria) { … }
bool IsInstallableDisplayMode(blink::mojom::DisplayMode display_mode) { … }
}
InstallableStatusCode InstallableEvaluator::GetDisplayError(
const blink::mojom::Manifest& manifest,
InstallableCriteria criteria) { … }
InstallableEvaluator::InstallableEvaluator(content::WebContents* web_contents,
const InstallablePageData& data,
InstallableCriteria criteria)
: … { … }
InstallableEvaluator::~InstallableEvaluator() = default;
int InstallableEvaluator::GetMinimumIconSizeInPx() { … }
std::optional<std::vector<InstallableStatusCode>>
InstallableEvaluator::CheckInstallability() const { … }
std::vector<InstallableStatusCode> InstallableEvaluator::CheckEligibility(
content::WebContents* web_contents) const { … }
bool InstallableEvaluator::IsContentSecure(content::WebContents* web_contents) { … }
bool InstallableEvaluator::IsOriginConsideredSecure(const GURL& url) { … }
}