#include "chrome/browser/screen_ai/screen_ai_install_state.h"
#include <memory>
#include "base/check_is_test.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/screen_ai/pref_names.h"
#include "components/prefs/pref_service.h"
#include "services/screen_ai/public/cpp/utilities.h"
#include "ui/accessibility/accessibility_features.h"
#if BUILDFLAG(IS_LINUX)
#include "base/cpu.h"
#include "base/files/file_util.h"
#endif
namespace {
const int kScreenAICleanUpDelayInDays = …;
const char kMinExpectedVersion[] = …;
bool IsDeviceCompatible() { … }
}
namespace screen_ai {
ScreenAIInstallState* g_instance = …;
ScreenAIInstallState* ScreenAIInstallState::GetInstance() { … }
bool ScreenAIInstallState::VerifyLibraryVersion(const base::Version& version) { … }
ScreenAIInstallState::ScreenAIInstallState() { … }
ScreenAIInstallState::~ScreenAIInstallState() { … }
bool ScreenAIInstallState::ShouldInstall(PrefService* local_state) { … }
void ScreenAIInstallState::RecordComponentInstallationResult(bool install,
bool successful) { … }
void ScreenAIInstallState::AddObserver(
ScreenAIInstallState::Observer* observer) { … }
void ScreenAIInstallState::DownloadComponent() { … }
void ScreenAIInstallState::RemoveObserver(
ScreenAIInstallState::Observer* observer) { … }
void ScreenAIInstallState::SetComponentFolder(
const base::FilePath& component_folder) { … }
void ScreenAIInstallState::SetState(State state) { … }
void ScreenAIInstallState::SetDownloadProgress(double progress) { … }
bool ScreenAIInstallState::IsComponentAvailable() { … }
bool ScreenAIInstallState::MayTryDownload() { … }
void ScreenAIInstallState::ResetForTesting() { … }
void ScreenAIInstallState::SetStateForTesting(State state) { … }
}