#include "components/soda/constants.h"
#include <optional>
#include <string>
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/metrics/field_trial_params.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/crx_file/id_util.h"
#include "media/base/media_switches.h"
#include "ui/base/l10n/l10n_util.h"
namespace speech {
const char kUsEnglishLocale[] = …;
const char kEnglishLocaleNoCountry[] = …;
const char kChineseLocaleNoCountry[] = …;
const char kSodaBinaryInstallationResult[] = …;
const char kSodaBinaryInstallationSuccessTimeTaken[] = …;
const char kSodaBinaryInstallationFailureTimeTaken[] = …;
#if BUILDFLAG(IS_WIN)
constexpr base::FilePath::CharType kSodaBinaryRelativePath[] =
FILE_PATH_LITERAL("SODAFiles/SODA.dll");
#else
constexpr base::FilePath::CharType kSodaBinaryRelativePath[] = …);
#endif
constexpr base::FilePath::CharType kSodaTestBinaryRelativePath[] = …);
constexpr base::FilePath::CharType kSodaTestResourcesRelativePath[] = …);
constexpr base::FilePath::CharType kSodaInstallationRelativePath[] = …);
constexpr base::FilePath::CharType kSodaLanguagePacksRelativePath[] = …);
constexpr base::FilePath::CharType kSodaLanguagePackDirectoryRelativePath[] = …);
const base::FilePath GetSodaDirectory() { … }
const base::FilePath GetSodaLanguagePacksDirectory() { … }
const base::FilePath GetSodaTestResourcesDirectory() { … }
const base::FilePath GetLatestSodaLanguagePackDirectory(
const std::string& language) { … }
const base::FilePath GetLatestSodaDirectory() { … }
const base::FilePath GetSodaBinaryPath() { … }
const base::FilePath GetSodaTestBinaryPath() { … }
std::optional<SodaLanguagePackComponentConfig> GetLanguageComponentConfig(
LanguageCode language_code) { … }
std::optional<SodaLanguagePackComponentConfig> GetLanguageComponentConfig(
const std::string& language_name) { … }
std::optional<SodaLanguagePackComponentConfig>
GetLanguageComponentConfigMatchingLanguageSubtag(
const std::string& language_name) { … }
LanguageCode GetLanguageCodeByComponentId(const std::string& component_id) { … }
std::string GetLanguageName(LanguageCode language_code) { … }
LanguageCode GetLanguageCode(const std::string& language_name) { … }
const std::u16string GetLanguageDisplayName(const std::string& language_name,
const std::string& display_locale) { … }
const std::string GetInstallationSuccessTimeMetricForLanguagePack(
const LanguageCode& language_code) { … }
const std::string GetInstallationSuccessTimeMetricForLanguage(
const std::string& language) { … }
const std::string GetInstallationFailureTimeMetricForLanguagePack(
const LanguageCode& language_code) { … }
const std::string GetInstallationFailureTimeMetricForLanguage(
const std::string& language) { … }
const std::string GetInstallationResultMetricForLanguagePack(
const LanguageCode& language_code) { … }
const std::string GetInstallationResultMetricForLanguage(
const std::string& language) { … }
}