void TextInputController::unmarkText(const CppArgumentList&, CppVariant* result) { result->setNull(); WebFrame* mainFrame = getMainFrame(); if (!mainFrame) return; mainFrame->unmarkText(); }
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())); }