chromium/components/page_info/core/about_this_site_validation.h

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

#ifndef COMPONENTS_PAGE_INFO_CORE_ABOUT_THIS_SITE_VALIDATION_H_
#define COMPONENTS_PAGE_INFO_CORE_ABOUT_THIS_SITE_VALIDATION_H_

#include <optional>

#include "components/page_info/core/proto/about_this_site_metadata.pb.h"

namespace page_info::about_this_site_validation {

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
// Keep in sync with AboutThisSiteStatus in enums.xml
enum class AboutThisSiteStatus {};

AboutThisSiteStatus ValidateMetadata(
    const std::optional<proto::AboutThisSiteMetadata>& metadata);

AboutThisSiteStatus ValidateSource(const proto::Hyperlink& link);
AboutThisSiteStatus ValidateDescription(
    const proto::SiteDescription& description);
AboutThisSiteStatus ValidateFirstSeen(const proto::SiteFirstSeen& first_seen);
AboutThisSiteStatus ValidateMoreAbout(const proto::MoreAbout& more_about);
AboutThisSiteStatus ValidateSiteInfo(const proto::SiteInfo& site_info);

}  // namespace page_info::about_this_site_validation

#endif  // COMPONENTS_PAGE_INFO_CORE_ABOUT_THIS_SITE_VALIDATION_H_