Revert "Spellcheck: Apply policy for languages that lack Hunspell support"
This reverts commit 1527cb7a. Reason for revert: TestCases/SpellcheckLanguagePolicyHandlersTest.ApplyPolicySettings fails on win7 bot See crbug.com/1068703 for more info. Original change's description: > Spellcheck: Apply policy for languages that lack Hunspell support > > Spellcheck languages that have Windows platform support but not > Hunspell support (Arabic, Finnish, ...) cannot be disabled or forced > enabled by enterprise policy. This is because of the use of > spellcheck::GetCorrespondingSpellCheckLanguage in > SpellcheckLanguageBlacklistPolicyHandler::SortBlacklistedLanguages and > SpellcheckLanguagePolicyHandler::SortForcedLanguages, a method that > only recognizes Hunspell languages. > > The fix is to instead check if a language with policy being enforced is > on the list of supported accept languages, as these are what are used > to populate the language list on the language settings page. Note that > in the upcoming implementation of support for non-Hunspell languages, > we will only allow Windows platform spellchecking for these accept > languages (if they have a Windows spellcheck dictionary). > > Instead of just searching for the accept language within the tag, the > algorithm first tries for an exact match (so "en-CA" would be found), > then searches for an exact match for the language without locale > info, that is, what's to the left of the hyphen in a language tag > (so "ar" would be found for "ar-SA"). > > Also adds unit test coverage for the spellcheck policy handlers, which > previously had none. > > Note that there is an interplay between forced and blocked languages, > as well as the spellcheck-enabled policy: > > 1) If a language is both forced and blocked, forced wins. > 2) If spellcheck is disabled by policy, the forced/blocked languages > policy has no effect. > > Test cases cover this interplay. > > Bug: 1056850 > Change-Id: Iec54a851d38f00a7aa7597449f7acc30f3dd2de3 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080450 > Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> > Reviewed-by: Avi Drissman <avi@chromium.org> > Commit-Queue: Bruce Long <brlong@microsoft.com> > Cr-Commit-Position: refs/heads/master@{#757107} TBR=avi@chromium.org,rouslan@chromium.org,pcupp@microsoft.com,brlong@microsoft.com,gujen@google.com Change-Id: I4653ecce1cb2b7162d1a3eba5a5e7ef2238943ad No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 1056850, 1068703 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140672Reviewed-by:Chris Sharp <csharp@chromium.org> Commit-Queue: Chris Sharp <csharp@chromium.org> Cr-Commit-Position: refs/heads/master@{#757188}
Showing
Please register or sign in to comment