Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: chrome/browser/spellchecker/spellcheck_message_filter_mac.cc

Issue 928473002: [mac] Init spellcheck service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move service init to UI thread. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spellcheck_message_filter_mac.cc
diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc b/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc
index 8d0be53e0b111af596e514663261c7c7ecbccf8c..9228cd3b9e211e80a9f426995044eae88654fb14 100644
--- a/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc
+++ b/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc
@@ -265,6 +265,13 @@ void SpellCheckMessageFilterMac::OnRequestTextCheck(
std::vector<SpellCheckMarker> markers) {
DCHECK(!text.empty());
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).
markers.erase(
std::remove_if(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698