diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/spellcheck/renderer/spelling_engine.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/spellcheck/renderer/spelling_engine.cc')
-rw-r--r-- | chromium/components/spellcheck/renderer/spelling_engine.cc | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/chromium/components/spellcheck/renderer/spelling_engine.cc b/chromium/components/spellcheck/renderer/spelling_engine.cc index 5d27e2cbede..c2b048bab47 100644 --- a/chromium/components/spellcheck/renderer/spelling_engine.cc +++ b/chromium/components/spellcheck/renderer/spelling_engine.cc @@ -20,29 +20,19 @@ SpellingEngine* CreateNativeSpellingEngine( service_manager::LocalInterfaceProvider* embedder_provider) { DCHECK(embedder_provider); -#if BUILDFLAG(USE_BROWSER_SPELLCHECKER) #if defined(OS_WIN) - if (spellcheck::UseWinHybridSpellChecker()) { - // On Windows, when using the hybrid spellchecker, both Hunspell and the - // platform are used for spellchecking. Ideally we'd want to know which - // languages are supported by the platform spellchecker, and only create a - // HunspellEngine for languages that aren't. Unfortunately, performing that - // check must be done asynchronously on the browser side, while this - // function must return synchronously. However, because the platform - // spellchecker uses a code path that does not involve a SpellingEngine when - // performing spellchecking, a solution is to create a HunspellEngine for - // every language, even those that the platform supports. Because the - // languages that the platform spellchecker supports are initialized on the - // browser side, the HunspellEngine returned here will remain disabled for - // these languages, so they will be skipped when performing the Hunspell - // check. - return new HunspellEngine(embedder_provider); - } else if (spellcheck::UseBrowserSpellChecker()) { - return new PlatformSpellingEngine(embedder_provider); - } -#else - return new PlatformSpellingEngine(embedder_provider); + // On Windows, always return a HunspellEngine. This is a simplification to + // avoid needing an async Mojo call to the browser process to determine which + // languages are supported by the native spell checker. Returning a + // HunspellEngine for languages supported by the native spell checker is + // harmless because the SpellingEngine object returned here is never used + // during native spell checking. It also doesn't affect Hunspell, since these + // languages are skipped during the Hunspell check. + return new HunspellEngine(embedder_provider); #endif // defined(OS_WIN) + +#if BUILDFLAG(USE_BROWSER_SPELLCHECKER) + return new PlatformSpellingEngine(embedder_provider); #endif // BUILDFLAG(USE_BROWSER_SPELLCHECKER) #if BUILDFLAG(USE_RENDERER_SPELLCHECKER) |