feat: enable builtin spellchecker (#20692)

* chore: add code required to use chromes spellchecker

* chore: fix linting

* chore: manifests needs buildflags now

* chore: add dictionarySuggestions to the context menu event when the spellchecker is active

* chore: enable by default for windows builds

* chore: add patch to remove incognito usage in the spellchecker

* chore: add dependencies on spellcheck common and flags

* chore: conditionally include spell check panel impl

* chore: fix deps for spellcheck feature flags

* chore: add patch for electron resources

* chore: add dependency on //components/language/core/browser

* chore: patches to make hunspell work on windows

* build: collect hunspell dictionaries into a zip file and publish

* chore: clean up patches

* chore: add docs and set spell checker url method

* chore: fix error handling

* chore: fix hash logic

* build: update hunspell filename generator

* fix: default spellchecker list to the current system locale if we can

* docs: document the language getter

* chore: patch IDS_ resources for linux builds

* feat: add spellcheck webpref flag to disable the builtin spellchecker

* chore: fix docs typo

* chore: clean up spellchecker impl as per feedback

* remove unneeded deps
This commit is contained in:
Samuel Attard 2019-10-31 13:11:51 -07:00 committed by GitHub
parent 23ca7e3733
commit 6bcf67e051
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 560 additions and 10 deletions

View file

@ -144,6 +144,9 @@ WebContentsPreferences::WebContentsPreferences(
SetDefaultBoolIfUndefined(options::kScrollBounce, false);
#endif
SetDefaultBoolIfUndefined(options::kOffscreen, false);
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
SetDefaultBoolIfUndefined(options::kSpellcheck, true);
#endif
// If this is a <webview> tag, and the embedder is offscreen-rendered, then
// this WebContents is also offscreen-rendered.
@ -414,6 +417,12 @@ void WebContentsPreferences::AppendCommandLineSwitches(
if (IsEnabled(options::kNodeIntegrationInSubFrames))
command_line->AppendSwitch(switches::kNodeIntegrationInSubFrames);
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
if (IsEnabled(options::kSpellcheck)) {
command_line->AppendSwitch(switches::kEnableSpellcheck);
}
#endif
// We are appending args to a webContents so let's save the current state
// of our preferences object so that during the lifetime of the WebContents
// we can fetch the options used to initally configure the WebContents