WebKitFormClient.cpp [plain text]
#include "config.h"
#include "WebKitFormClient.h"
#include "WebKitFormSubmissionRequestPrivate.h"
#include "WebKitPrivate.h"
#include "WebKitWebViewBasePrivate.h"
#include "WebKitWebViewPrivate.h"
#include <wtf/gobject/GRefPtr.h>
using namespace WebKit;
static void willSubmitForm(WKPageRef page, WKFrameRef frame, WKFrameRef sourceFrame, WKDictionaryRef values, WKTypeRef userData, WKFormSubmissionListenerRef listener, const void* clientInfo)
{
GRefPtr<WebKitFormSubmissionRequest> request = adoptGRef(webkitFormSubmissionRequestCreate(toImpl(values), toImpl(listener)));
webkitWebViewSubmitFormRequest(WEBKIT_WEB_VIEW(clientInfo), request.get());
}
void attachFormClientToView(WebKitWebView* webView)
{
WKPageFormClient wkFormClient = {
kWKPageFormClientCurrentVersion,
webView, willSubmitForm
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageFormClient(wkPage, &wkFormClient);
}