#include "chrome/browser/component_updater/optimization_guide_on_device_model_installer.h"
#include <cstdint>
#include <iterator>
#include <memory>
#include <string>
#include <vector>
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/browser_process.h"
#include "components/optimization_guide/core/model_execution/on_device_model_component.h"
#include "components/update_client/update_client.h"
#include "components/update_client/update_client_errors.h"
#include "content/public/browser/browser_thread.h"
#include "crypto/sha2.h"
OnDeviceModelComponentStateManager;
namespace component_updater {
namespace {
constexpr char kManifestName[] = …;
constexpr base::FilePath::CharType kInstallationRelativePath[] = …);
constexpr uint8_t kPublicKeySHA256[32] = …;
static_assert …;
}
OptimizationGuideOnDeviceModelInstallerPolicy::
OptimizationGuideOnDeviceModelInstallerPolicy(
scoped_refptr<optimization_guide::OnDeviceModelComponentStateManager>
state_manager)
: … { … }
OptimizationGuideOnDeviceModelInstallerPolicy::
~OptimizationGuideOnDeviceModelInstallerPolicy() { … }
bool OptimizationGuideOnDeviceModelInstallerPolicy::VerifyInstallation(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) const { … }
bool OptimizationGuideOnDeviceModelInstallerPolicy::
SupportsGroupPolicyEnabledComponentUpdates() const { … }
bool OptimizationGuideOnDeviceModelInstallerPolicy::RequiresNetworkEncryption()
const { … }
update_client::CrxInstaller::Result
OptimizationGuideOnDeviceModelInstallerPolicy::OnCustomInstall(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) { … }
void OptimizationGuideOnDeviceModelInstallerPolicy::OnCustomUninstall() { … }
void OptimizationGuideOnDeviceModelInstallerPolicy::ComponentReady(
const base::Version& version,
const base::FilePath& install_dir,
base::Value::Dict manifest) { … }
base::FilePath
OptimizationGuideOnDeviceModelInstallerPolicy::GetRelativeInstallDir() const { … }
void OptimizationGuideOnDeviceModelInstallerPolicy::GetHash(
std::vector<uint8_t>* hash) const { … }
std::string OptimizationGuideOnDeviceModelInstallerPolicy::GetName() const { … }
update_client::InstallerAttributes
OptimizationGuideOnDeviceModelInstallerPolicy::GetInstallerAttributes() const { … }
bool OptimizationGuideOnDeviceModelInstallerPolicy::AllowCachedCopies() const { … }
bool OptimizationGuideOnDeviceModelInstallerPolicy::
AllowUpdatesOnMeteredConnections() const { … }
void RegisterOptimizationGuideOnDeviceModelComponent(
ComponentUpdateService* cus,
scoped_refptr<OnDeviceModelComponentStateManager> state_manager) { … }
void UninstallOptimizationGuideOnDeviceModelComponent(
scoped_refptr<OnDeviceModelComponentStateManager> state_manager) { … }
}