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

Unified Diff: chrome/renderer/render_view.cc

Issue 357003: Move the spellchecker to the renderer.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rename Created 11 years, 1 month 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
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 31117)
+++ chrome/renderer/render_view.cc (working copy)
@@ -52,6 +52,9 @@
#include "chrome/renderer/plugin_channel_host.h"
#include "chrome/renderer/print_web_view_helper.h"
#include "chrome/renderer/render_process.h"
+#if defined(SPELLCHECKER_IN_RENDERER)
+#include "chrome/renderer/spellchecker/spellcheck.h"
+#endif
#include "chrome/renderer/user_script_slave.h"
#include "chrome/renderer/visitedlink_slave.h"
#include "chrome/renderer/webplugin_delegate_pepper.h"
@@ -1496,8 +1499,16 @@
int& misspelled_offset,
int& misspelled_length) {
EnsureDocumentTag();
+
+#if defined(SPELLCHECKER_IN_RENDERER)
+ string16 word(text);
+ RenderThread::current()->spellchecker()->SpellCheckWord(
+ word.c_str(), word.size(), document_tag_,
+ &misspelled_offset, &misspelled_length, NULL);
+#else
Send(new ViewHostMsg_SpellCheck(routing_id_, text, document_tag_,
&misspelled_offset, &misspelled_length));
+#endif
}
WebString RenderView::autoCorrectWord(const WebKit::WebString& word) {
@@ -1505,8 +1516,14 @@
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kExperimentalSpellcheckerFeatures)) {
EnsureDocumentTag();
+#if defined(SPELLCHECKER_IN_RENDERER)
+ autocorrect_word =
+ RenderThread::current()->spellchecker()->GetAutoCorrectionWord(
+ word, document_tag_);
+#else
Send(new ViewHostMsg_GetAutoCorrectWord(
routing_id_, word, document_tag_, &autocorrect_word));
+#endif
}
return autocorrect_word;
}

Powered by Google App Engine
This is Rietveld 408576698