Commit 0d4d96fe authored by Bruce Long's avatar Bruce Long Committed by Commit Bot

Windows Spellcheck: Adding word via language settings page fails

For Windows spellcheck, adding/removing word via language settings
page should commit to platform custom dictionary. Fix is to make same
calls to spellcheck_platform::AddWord and
spellcheck_platform::RemoveWord that are performed when adding or
removing a word using the spelling context menu.

Bug: 993072
Change-Id: I97f9c91c0f5dfdce475f2f9e09fefc98efd44b0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750105Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Bruce Long <brlong@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#686440}
parent 6c89e926
......@@ -35,7 +35,9 @@
#include "components/language/core/browser/pref_names.h"
#include "components/language/core/common/language_util.h"
#include "components/language/core/common/locale_util.h"
#include "components/spellcheck/browser/spellcheck_platform.h"
#include "components/spellcheck/common/spellcheck_common.h"
#include "components/spellcheck/common/spellcheck_features.h"
#include "components/translate/core/browser/translate_download_manager.h"
#include "components/translate/core/browser/translate_prefs.h"
#include "third_party/icu/source/i18n/unicode/coll.h"
......@@ -495,6 +497,12 @@ LanguageSettingsPrivateAddSpellcheckWordFunction::Run() {
SpellcheckServiceFactory::GetForContext(browser_context());
bool success = service->GetCustomDictionary()->AddWord(params->word);
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
if (spellcheck::UseBrowserSpellChecker()) {
spellcheck_platform::AddWord(base::UTF8ToUTF16(params->word));
}
#endif
return RespondNow(OneArgument(std::make_unique<base::Value>(success)));
}
......@@ -514,6 +522,12 @@ LanguageSettingsPrivateRemoveSpellcheckWordFunction::Run() {
SpellcheckServiceFactory::GetForContext(browser_context());
bool success = service->GetCustomDictionary()->RemoveWord(params->word);
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
if (spellcheck::UseBrowserSpellChecker()) {
spellcheck_platform::RemoveWord(base::UTF8ToUTF16(params->word));
}
#endif
return RespondNow(OneArgument(std::make_unique<base::Value>(success)));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment