From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- .../spellcheck/renderer/spelling_engine.cc | 32 ++++++++-------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'chromium/components/spellcheck/renderer/spelling_engine.cc') 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) -- cgit v1.2.1