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

Unified Diff: chrome/renderer/spellchecker/spellcheck_provider.cc

Issue 6813090: Chrome side needed for WebKit change to move the little remaining spellcheck code out of RenderView. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | content/renderer/render_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck_provider.cc
===================================================================
--- chrome/renderer/spellchecker/spellcheck_provider.cc (revision 81105)
+++ chrome/renderer/spellchecker/spellcheck_provider.cc (working copy)
@@ -20,6 +20,7 @@
using WebKit::WebString;
using WebKit::WebTextCheckingCompletion;
using WebKit::WebTextCheckingResult;
+using WebKit::WebVector;
SpellCheckProvider::SpellCheckProvider(RenderView* render_view,
SpellCheck* spellcheck)
@@ -76,21 +77,32 @@
return handled;
}
-void SpellCheckProvider::spellCheck(const WebString& text,
- int& misspelled_offset,
- int& misspelled_length) {
+void SpellCheckProvider::spellCheck(
+ const WebString& text,
+ int& offset,
+ int& length,
+ WebVector<WebString>* optional_suggestions) {
EnsureDocumentTag();
string16 word(text);
RenderThread* thread = RenderThread::current();
// Will be NULL during unit tests.
if (thread) {
+ std::vector<string16> suggestions;
thread->spellchecker()->SpellCheckWord(
word.c_str(), word.size(), document_tag_,
- &misspelled_offset, &misspelled_length, NULL);
+ &offset, &length, optional_suggestions ? & suggestions : NULL);
+ if (optional_suggestions)
+ *optional_suggestions = suggestions;
}
}
+void SpellCheckProvider::spellCheck(const WebString& text,
+ int& offset,
+ int& length) {
+ spellCheck(text, offset, length, NULL);
+}
+
void SpellCheckProvider::requestCheckingOfText(
const WebString& text,
WebTextCheckingCompletion* completion) {
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck_provider.h ('k') | content/renderer/render_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698