chore: make macOS spellchecker fns formal no-ops (#35514)

* chore: make macOS spellchecker fns formal no-ops

* docs: correct no-op note

* test: add no-op specs
This commit is contained in:
Shelley Vohr 2022-09-15 00:10:16 +02:00 committed by GitHub
parent bf20aabb9e
commit 38a7da692a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 1 deletions

View file

@ -1043,6 +1043,7 @@ base::Value Session::GetSpellCheckerLanguages() {
void Session::SetSpellCheckerLanguages(
gin_helper::ErrorThrower thrower,
const std::vector<std::string>& languages) {
#if !BUILDFLAG(IS_MAC)
base::Value::List language_codes;
for (const std::string& lang : languages) {
std::string code = spellcheck::GetCorrespondingSpellCheckLanguage(lang);
@ -1058,10 +1059,12 @@ void Session::SetSpellCheckerLanguages(
// Enable spellcheck if > 0 languages, disable if no languages set
browser_context_->prefs()->SetBoolean(spellcheck::prefs::kSpellCheckEnable,
!languages.empty());
#endif
}
void SetSpellCheckerDictionaryDownloadURL(gin_helper::ErrorThrower thrower,
const GURL& url) {
#if !BUILDFLAG(IS_MAC)
if (!url.is_valid()) {
thrower.ThrowError(
"The URL you provided to setSpellCheckerDictionaryDownloadURL is not a "
@ -1069,6 +1072,7 @@ void SetSpellCheckerDictionaryDownloadURL(gin_helper::ErrorThrower thrower,
return;
}
SpellcheckHunspellDictionary::SetBaseDownloadURL(url);
#endif
}
v8::Local<v8::Promise> Session::ListWordsInSpellCheckerDictionary() {