fix: re-enable the spellchecker when new language list set (#26119)

* fix: re-enable the spellchecker when new language list set

Chromium recently added prefs logic to disable the spellchecker if the list of languages is empty, but the logic to re-enable if the languages are provided again lives in another part of Chromium.  This change makes it so our API re-enables the spellchecker correctly when required.

* chore: fix lint
This commit is contained in:
Samuel Attard 2020-10-23 00:34:19 -07:00 committed by GitHub
parent 6181c03df0
commit 9d18f9d54f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 3 deletions

View file

@ -957,6 +957,9 @@ void Session::SetSpellCheckerLanguages(
}
browser_context_->prefs()->Set(spellcheck::prefs::kSpellCheckDictionaries,
language_codes);
// Enable spellcheck if > 0 languages, disable if no languages set
browser_context_->prefs()->SetBoolean(spellcheck::prefs::kSpellCheckEnable,
!languages.empty());
}
void SetSpellCheckerDictionaryDownloadURL(gin_helper::ErrorThrower thrower,