#include "components/translate/core/browser/translate_language_list.h"
#include <stddef.h>
#include <iterator>
#include <optional>
#include <string_view>
#include "base/check.h"
#include "base/debug/dump_without_crashing.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/lazy_instance.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "components/language/core/browser/accept_languages_service.h"
#include "components/language/core/common/locale_util.h"
#include "components/translate/core/browser/translate_browser_metrics.h"
#include "components/translate/core/browser/translate_download_manager.h"
#include "components/translate/core/browser/translate_event_details.h"
#include "components/translate/core/browser/translate_url_fetcher.h"
#include "components/translate/core/browser/translate_url_util.h"
#include "components/translate/core/common/translate_util.h"
#include "net/base/url_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
namespace translate {
namespace {
const char* const kDefaultSupportedLanguages[] = …;
const char* const kDefaultSupportedPartialTranslateLanguages[] = …;
const char kLanguageListFetchPath[] = …;
bool update_is_disabled = …;
const int kMaxRetryOn5xx = …;
}
const char TranslateLanguageList::kTargetLanguagesKey[] = …;
TranslateLanguageList::TranslateLanguageList()
: … { … }
TranslateLanguageList::~TranslateLanguageList() { … }
void TranslateLanguageList::GetSupportedLanguages(
bool translate_allowed,
std::vector<std::string>* languages) { … }
void TranslateLanguageList::GetSupportedPartialTranslateLanguages(
std::vector<std::string>* languages) { … }
std::string TranslateLanguageList::GetLanguageCode(std::string_view language) { … }
bool TranslateLanguageList::IsSupportedLanguage(std::string_view language) { … }
bool TranslateLanguageList::IsSupportedPartialTranslateLanguage(
std::string_view language) { … }
GURL TranslateLanguageList::TranslateLanguageUrl() { … }
void TranslateLanguageList::RequestLanguageList() { … }
void TranslateLanguageList::SetResourceRequestsAllowed(bool allowed) { … }
base::CallbackListSubscription TranslateLanguageList::RegisterEventCallback(
const EventCallback& callback) { … }
bool TranslateLanguageList::HasOngoingLanguageListLoadingForTesting() { … }
GURL TranslateLanguageList::LanguageFetchURLForTesting() { … }
void TranslateLanguageList::DisableUpdate() { … }
void TranslateLanguageList::OnLanguageListFetchComplete(
bool success,
const std::string& data) { … }
void TranslateLanguageList::NotifyEvent(int line, std::string message) { … }
bool TranslateLanguageList::SetSupportedLanguages(
std::string_view language_list) { … }
}