Commit 4ca14cb4 authored by rouslan's avatar rouslan Committed by Commit bot

[mac] Init spellcheck service.

BUG=454992

Review URL: https://codereview.chromium.org/928473002

Cr-Commit-Position: refs/heads/master@{#317179}
parent c2d9552d
...@@ -265,6 +265,13 @@ void SpellCheckMessageFilterMac::OnRequestTextCheck( ...@@ -265,6 +265,13 @@ void SpellCheckMessageFilterMac::OnRequestTextCheck(
std::vector<SpellCheckMarker> markers) { std::vector<SpellCheckMarker> markers) {
DCHECK(!text.empty()); DCHECK(!text.empty());
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
// Initialize the spellcheck service if needed. The service will send the
// language code for text breaking to the renderer. (Text breaking is required
// for the context menu to show spelling suggestions.) Initialization must
// happen on UI thread.
SpellcheckServiceFactory::GetForRenderProcessId(render_process_id_);
// Erase invalid markers (with offsets out of boundaries of text length). // Erase invalid markers (with offsets out of boundaries of text length).
markers.erase( markers.erase(
std::remove_if( std::remove_if(
......
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