#include "components/soda/soda_installer.h"
#include <optional>
#include <string>
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/observer_list.h"
#include "base/strings/string_split.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "components/live_caption/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/soda/constants.h"
#include "components/soda/pref_names.h"
#include "media/base/media_switches.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#include "ash/constants/ash_pref_names.h"
#endif
namespace {
constexpr int kSodaCleanUpDelayInDays = …;
const constexpr char* const kDefaultEnabledLanguages[] = …;
}
namespace speech {
SodaInstaller* g_instance = …;
SodaInstaller* SodaInstaller::GetInstance() { … }
SodaInstaller::SodaInstaller() { … }
SodaInstaller::~SodaInstaller() { … }
void SodaInstaller::RegisterLocalStatePrefs(PrefRegistrySimple* registry) { … }
void SodaInstaller::Init(PrefService* profile_prefs,
PrefService* global_prefs) { … }
void SodaInstaller::InitLanguages(PrefService* profile_prefs,
PrefService* global_prefs) { … }
void SodaInstaller::SetUninstallTimer(PrefService* profile_prefs,
PrefService* global_prefs) { … }
std::string SodaInstaller::GetLanguageDlcNameForLocale(
const std::string& locale) const { … }
bool SodaInstaller::IsSodaInstalled(LanguageCode language_code) const { … }
bool SodaInstaller::IsSodaBinaryInstalled() const { … }
const std::set<LanguageCode> SodaInstaller::InstalledLanguages() const { … }
bool SodaInstaller::IsLanguageInstalled(LanguageCode language_code) const { … }
void SodaInstaller::AddObserver(Observer* observer) { … }
void SodaInstaller::RemoveObserver(Observer* observer) { … }
void SodaInstaller::NotifySodaInstalledForTesting(LanguageCode language_code) { … }
void SodaInstaller::NotifySodaErrorForTesting(LanguageCode language_code,
ErrorCode error_code) { … }
void SodaInstaller::UninstallSodaForTesting() { … }
void SodaInstaller::NotifySodaProgressForTesting(int progress,
LanguageCode language_code) { … }
bool SodaInstaller::IsAnyLanguagePackInstalledForTesting() const { … }
void SodaInstaller::RegisterRegisteredLanguagePackPref(
PrefRegistrySimple* registry) { … }
void SodaInstaller::NotifyOnSodaInstalled(LanguageCode language_code) { … }
void SodaInstaller::NotifyOnSodaInstallError(LanguageCode language_code,
ErrorCode error_code) { … }
void SodaInstaller::NotifyOnSodaProgress(LanguageCode language_code,
int progress) { … }
void SodaInstaller::RegisterLanguage(const std::string& language,
PrefService* global_prefs) { … }
void SodaInstaller::UnregisterLanguage(const std::string& language,
PrefService* global_prefs) { … }
void SodaInstaller::UnregisterLanguages(PrefService* global_prefs) { … }
bool SodaInstaller::IsSodaDownloading(LanguageCode language_code) const { … }
std::optional<SodaInstaller::ErrorCode> SodaInstaller::GetSodaInstallErrorCode(
LanguageCode language_code) const { … }
bool SodaInstaller::IsAnyFeatureUsingSodaEnabled(PrefService* prefs) { … }
std::vector<std::string> SodaInstaller::GetLiveCaptionEnabledLanguages() const { … }
}