Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Expose missing spell checking interface #301

Merged
merged 2 commits into from
Sep 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions brave/browser/brave_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,19 @@ void BraveContentBrowserClient::ExposeInterfacesToRenderer(
// gap between the preparation and the execution of that IPC.
associated_registry->AddInterface(
base::Bind(&CacheStatsRecorder::Create, render_process_host->GetID()));

scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner =
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI);
#if BUILDFLAG(ENABLE_SPELLCHECK)
registry->AddInterface(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's odd, I noticed this when reviewing and I thought I saw it in the final PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are still missing

+#if BUILDFLAG(HAS_SPELLCHECK_PANEL)
+    registry->AddInterface(base::Bind(&SpellCheckPanelHostImpl::Create),
+                           ui_task_runner);
+#endif

see 08fdafe21e81711142065b8251af2e5ecd268707

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is HAS_SPELLCHECK_PANEL ? are you sure that's something we need?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an MacOS feature and chromium uses it as a spell-correction aid for contentEditable,
and <textarea>, and designMode document content that has the
focus on the current web page.
We new a instance of SpellCheckPanel in our BraveContentRendererClient

base::Bind(&SpellCheckHostImpl::Create, render_process_host->GetID()),
ui_task_runner);
#endif
#if BUILDFLAG(HAS_SPELLCHECK_PANEL)
registry->AddInterface(base::Bind(&SpellCheckPanelHostImpl::Create),
ui_task_runner);
#endif
}

void BraveContentBrowserClient::BindInterfaceRequest(
Expand Down