chromium/components/webapps/browser/installable/installable_evaluator.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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;

// This constant is the icon size on Android (48dp) multiplied by the scale
// factor of a Nexus 5 device (3x). It is the currently advertised minimum icon
// size for triggering banners.
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) {}

// Returns whether |manifest| specifies an SVG or PNG icon that has
// IconPurpose::ANY, with size >= kMinimumPrimaryIconSizeInPx (or size "any").
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) {}

}  // namespace

InstallableStatusCode InstallableEvaluator::GetDisplayError(
    const blink::mojom::Manifest& manifest,
    InstallableCriteria criteria) {}

InstallableEvaluator::InstallableEvaluator(content::WebContents* web_contents,
                                           const InstallablePageData& data,
                                           InstallableCriteria criteria)
    :{}

InstallableEvaluator::~InstallableEvaluator() = default;

// static
int InstallableEvaluator::GetMinimumIconSizeInPx() {}

std::optional<std::vector<InstallableStatusCode>>
InstallableEvaluator::CheckInstallability() const {}

std::vector<InstallableStatusCode> InstallableEvaluator::CheckEligibility(
    content::WebContents* web_contents) const {}

// static
bool InstallableEvaluator::IsContentSecure(content::WebContents* web_contents) {}

// static
bool InstallableEvaluator::IsOriginConsideredSecure(const GURL& url) {}

}  // namespace webapps