#include "components/component_updater/installer_policies/tpcd_metadata_component_installer_policy.h"
#include <optional>
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/version.h"
#include "components/component_updater/component_updater_service.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/tpcd/metadata/browser/parser.h"
#include "net/base/features.h"
ComponentUpdateService;
namespace {
constexpr char kTpcdMetadataManifestName[] = …;
constexpr uint8_t kTpcdMetadataPublicKeySHA256[32] = …;
constexpr base::FilePath::CharType kRelInstallDirName[] = …);
std::optional<std::string> ReadComponentFromDisk(
const base::FilePath& file_path) { … }
base::FilePath GetComponentPath(const base::FilePath& install_dir) { … }
}
namespace component_updater {
TpcdMetadataComponentInstallerPolicy::TpcdMetadataComponentInstallerPolicy(
OnTpcdMetadataComponentReadyCallback on_component_ready_callback)
: … { … }
TpcdMetadataComponentInstallerPolicy::~TpcdMetadataComponentInstallerPolicy() =
default;
bool TpcdMetadataComponentInstallerPolicy::
SupportsGroupPolicyEnabledComponentUpdates() const { … }
bool TpcdMetadataComponentInstallerPolicy::RequiresNetworkEncryption() const { … }
update_client::CrxInstaller::Result
TpcdMetadataComponentInstallerPolicy::OnCustomInstall(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) { … }
void TpcdMetadataComponentInstallerPolicy::OnCustomUninstall() { … }
void TpcdMetadataComponentInstallerPolicy::ComponentReady(
const base::Version& version,
const base::FilePath& install_dir,
base::Value::Dict manifest) { … }
void WriteMetrics(tpcd::metadata::InstallationResult result) { … }
bool TpcdMetadataComponentInstallerPolicy::VerifyInstallation(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) const { … }
base::FilePath TpcdMetadataComponentInstallerPolicy::GetRelativeInstallDir()
const { … }
void TpcdMetadataComponentInstallerPolicy::GetPublicKeyHash(
std::vector<uint8_t>* hash) { … }
void TpcdMetadataComponentInstallerPolicy::GetHash(
std::vector<uint8_t>* hash) const { … }
std::string TpcdMetadataComponentInstallerPolicy::GetName() const { … }
update_client::InstallerAttributes
TpcdMetadataComponentInstallerPolicy::GetInstallerAttributes() const { … }
}