#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/component_updater/screen_ai_component_installer.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/screen_ai/screen_ai_install_state.h"
#include "components/component_updater/component_updater_service.h"
#include "components/crx_file/id_util.h"
#include "components/update_client/update_client_errors.h"
#include "content/public/browser/browser_thread.h"
#include "crypto/sha2.h"
#include "services/screen_ai/public/cpp/utilities.h"
BrowserThread;
namespace {
constexpr uint8_t kScreenAIPublicKeySHA256[32] = …;
static_assert …;
constexpr char kScreenAIManifestName[] = …;
}
namespace component_updater {
ScreenAIComponentInstallerPolicy::ScreenAIComponentInstallerPolicy() = default;
ScreenAIComponentInstallerPolicy::~ScreenAIComponentInstallerPolicy() = default;
bool ScreenAIComponentInstallerPolicy::
SupportsGroupPolicyEnabledComponentUpdates() const { … }
bool ScreenAIComponentInstallerPolicy::RequiresNetworkEncryption() const { … }
update_client::CrxInstaller::Result
ScreenAIComponentInstallerPolicy::OnCustomInstall(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) { … }
void ScreenAIComponentInstallerPolicy::OnCustomUninstall() { … }
void ScreenAIComponentInstallerPolicy::ComponentReady(
const base::Version& version,
const base::FilePath& install_dir,
base::Value::Dict manifest) { … }
bool ScreenAIComponentInstallerPolicy::VerifyInstallation(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) const { … }
base::FilePath ScreenAIComponentInstallerPolicy::GetRelativeInstallDir() const { … }
std::string ScreenAIComponentInstallerPolicy::GetOmahaId() { … }
void ScreenAIComponentInstallerPolicy::GetHash(
std::vector<uint8_t>* hash) const { … }
std::string ScreenAIComponentInstallerPolicy::GetName() const { … }
update_client::InstallerAttributes
ScreenAIComponentInstallerPolicy::GetInstallerAttributes() const { … }
void ScreenAIComponentInstallerPolicy::DeleteComponent() { … }
void ManageScreenAIComponentRegistration(ComponentUpdateService* cus,
PrefService* local_state) { … }
void RegisterScreenAIComponent(ComponentUpdateService* cus) { … }
}