|
@@ -785,6 +785,21 @@ bool Session::AddWordToSpellCheckerDictionary(const std::string& word) {
|
|
|
#endif
|
|
|
return service->GetCustomDictionary()->AddWord(word);
|
|
|
}
|
|
|
+
|
|
|
+bool Session::RemoveWordFromSpellCheckerDictionary(const std::string& word) {
|
|
|
+ SpellcheckService* service =
|
|
|
+ SpellcheckServiceFactory::GetForContext(browser_context_.get());
|
|
|
+ if (!service)
|
|
|
+ return false;
|
|
|
+
|
|
|
+#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
|
|
|
+ if (spellcheck::UseBrowserSpellChecker()) {
|
|
|
+ spellcheck_platform::RemoveWord(service->platform_spell_checker(),
|
|
|
+ base::UTF8ToUTF16(word));
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ return service->GetCustomDictionary()->RemoveWord(word);
|
|
|
+}
|
|
|
#endif
|
|
|
|
|
|
// static
|
|
@@ -873,6 +888,8 @@ void Session::BuildPrototype(v8::Isolate* isolate,
|
|
|
&SetSpellCheckerDictionaryDownloadURL)
|
|
|
.SetMethod("addWordToSpellCheckerDictionary",
|
|
|
&Session::AddWordToSpellCheckerDictionary)
|
|
|
+ .SetMethod("removeWordFromSpellCheckerDictionary",
|
|
|
+ &Session::RemoveWordFromSpellCheckerDictionary)
|
|
|
#endif
|
|
|
.SetMethod("preconnect", &Session::Preconnect)
|
|
|
.SetProperty("cookies", &Session::Cookies)
|