#include "components/soda/soda_util.h"
#include <string>
#include "base/feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/soda/constants.h"
#include "components/soda/soda_installer.h"
#include "media/base/media_switches.h"
#include "ui/base/l10n/l10n_util.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#include "base/feature_list.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/startup/browser_params_proxy.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "base/win/windows_version.h"
#endif
#if BUILDFLAG(IS_LINUX) && defined(ARCH_CPU_X86_FAMILY)
#include "base/cpu.h"
#endif
namespace speech {
namespace {
#if BUILDFLAG(IS_CHROMEOS)
bool IsSupportedChromeOS() {
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (!base::FeatureList::IsEnabled(
ash::features::kOnDeviceSpeechRecognition)) {
return false;
}
#elif BUILDFLAG(IS_CHROMEOS_LACROS)
if (!chromeos::BrowserParamsProxy::Get()->IsOndeviceSpeechSupported()) {
return false;
}
#endif
return true;
}
#endif
#if BUILDFLAG(IS_LINUX)
bool IsSupportedLinux() { … }
#endif
#if BUILDFLAG(IS_WIN)
bool IsSupportedWin() {
#if defined(ARCH_CPU_ARM64)
return false;
#else
return true;
#endif
}
#endif
}
bool IsOnDeviceSpeechRecognitionSupported() { … }
bool IsOnDeviceSpeechRecognitionAvailable(const std::string& language) { … }
}