void TextInputController::hasMarkedText(const CppArgumentList&, CppVariant* result) { result->setNull(); WebFrame* mainFrame = getMainFrame(); if (!mainFrame) return; result->set(mainFrame->hasMarkedText()); }
void TextInputController::insertText(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); WebFrame* mainFrame = getMainFrame(); if (!mainFrame) return; if (arguments.size() < 1 || !arguments[0].isString()) return; if (mainFrame->hasMarkedText()) { mainFrame->unmarkText(); mainFrame->replaceSelection(WebString()); } mainFrame->insertText(WebString::fromUTF8(arguments[0].toString())); }