Split the words before sending it to spellCheck

This commit is contained in:
Cheng Zhao 2014-12-19 20:42:19 -08:00
parent b801a93dc5
commit c6a18b1b59
7 changed files with 720 additions and 19 deletions

View file

@ -57,9 +57,16 @@ void WebFrame::AttachGuest(int id) {
content::RenderFrame::FromWebFrame(web_frame_)->AttachGuest(id);
}
void WebFrame::SetSpellCheckProvider(v8::Isolate* isolate,
void WebFrame::SetSpellCheckProvider(mate::Arguments* args,
const std::string& language,
v8::Handle<v8::Object> provider) {
spell_check_client_.reset(new SpellCheckClient(isolate, provider));
v8::Isolate* isolate = args->isolate();
if (!provider->Has(mate::StringToV8(isolate, "spellCheck"))) {
args->ThrowError("\"spellCheck\" has to be defined");
return;
}
spell_check_client_.reset(new SpellCheckClient(isolate, language, provider));
web_frame_->view()->setSpellCheckClient(spell_check_client_.get());
}