From 83a66e561707582021a709e6a7e991cad3b1ddd8 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Tue, 30 May 2017 21:24:46 -0700 Subject: [PATCH] Call WebView:SetTextCheckClient in initialization see chromium commits: https://chromium.googlesource.com/chromium/src.git/+/62dc793dc640ae5fd16d571a0c9199fe0fb740d0 -> https://chromium.googlesource.com/chromium/src.git/+/81bfb1741ab51947f5fc7c741eadd92779fe13b2 -> https://chromium.googlesource.com/chromium/src.git/+/1c4d759e44259650dfb2c426a7f997d2d0bc73dc -> https://chromium.googlesource.com/chromium/src.git/+/0c92b1cfa21b855c0e8c19f5550ae5209a325936 fix https://github.com/brave/browser-laptop/issues/9102 Auditors: @bridiver, @bbondy --- atom/renderer/api/atom_api_spell_check_client.h | 7 ++++--- brave/renderer/extensions/web_frame_bindings.cc | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/atom/renderer/api/atom_api_spell_check_client.h b/atom/renderer/api/atom_api_spell_check_client.h index d4190dee81..d3bce399d8 100644 --- a/atom/renderer/api/atom_api_spell_check_client.h +++ b/atom/renderer/api/atom_api_spell_check_client.h @@ -20,16 +20,16 @@ namespace atom { namespace api { class SpellCheckClient : public blink::WebSpellCheckClient, - blink::WebTextCheckClient { + public blink::WebTextCheckClient { public: SpellCheckClient(const std::string& language, bool auto_spell_correct_turned_on, v8::Isolate* isolate, v8::Local provider); - virtual ~SpellCheckClient(); + ~SpellCheckClient() override; private: - // blink::WebSpellCheckClient: + // blink::WebTextCheckClient: void CheckSpelling( const blink::WebString& text, int& offset, @@ -41,6 +41,7 @@ class SpellCheckClient : public blink::WebSpellCheckClient, void CancelAllPendingRequests() override {}; + // blink::WebSpellCheckClient: void ShowSpellingUI(bool show) override; bool IsShowingSpellingUI() override; void UpdateSpellingUIWithMisspelledWord( diff --git a/brave/renderer/extensions/web_frame_bindings.cc b/brave/renderer/extensions/web_frame_bindings.cc index 13edca3fe4..1e8c7e7021 100644 --- a/brave/renderer/extensions/web_frame_bindings.cc +++ b/brave/renderer/extensions/web_frame_bindings.cc @@ -144,6 +144,7 @@ void WebFrameBindings::SetSpellCheckProvider( new atom::api::SpellCheckClient( lang, auto_spell_correct_turned_on, GetIsolate(), provider)); context()->web_frame()->View()->SetSpellCheckClient(spell_check_client.get()); + context()->web_frame()->SetTextCheckClient(spell_check_client.get()); spell_check_client_.swap(spell_check_client); }