summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
commit815f1ed417bd26fbe2abbdf20ac5d3423b30796c (patch)
tree923c9a9e2834ccab60f5caecfb8f0ac410c1dd9e /Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
parentb4ad5d9d2b96baacd0180ead50de5195ca78af2d (diff)
downloadqtwebkit-815f1ed417bd26fbe2abbdf20ac5d3423b30796c.tar.gz
Imported WebKit commit e65cbc5b6ac32627c797e7fc7f46eb7794410c92 (http://svn.webkit.org/repository/webkit/trunk@123308)
New snapshot with better configure tests
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp')
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
index 8bfabeec6..8bf4d8fe0 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
@@ -29,6 +29,7 @@
#include "WebKitContextMenuPrivate.h"
#include "WebKitEnumTypes.h"
#include "WebKitError.h"
+#include "WebKitFormClient.h"
#include "WebKitFullscreenClient.h"
#include "WebKitHitTestResultPrivate.h"
#include "WebKitJavascriptResultPrivate.h"
@@ -90,6 +91,8 @@ enum {
CONTEXT_MENU,
CONTEXT_MENU_DISMISSED,
+ SUBMIT_FORM,
+
LAST_SIGNAL
};
@@ -325,6 +328,7 @@ static void webkitWebViewConstructed(GObject* object)
attachResourceLoadClientToView(webView);
attachFullScreenClientToView(webView);
attachContextMenuClientToView(webView);
+ attachFormClientToView(webView);
WebPageProxy* page = webkitWebViewBaseGetPage(webViewBase);
priv->backForwardList = adoptGRef(webkitBackForwardListCreate(WKPageGetBackForwardList(toAPI(page))));
@@ -1060,6 +1064,33 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
0, 0,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+
+ /**
+ * WebKitWebView::submit-form:
+ * @web_view: the #WebKitWebView on which the signal is emitted
+ * @request: a #WebKitFormSubmissionRequest
+ *
+ * This signal is emitted when a form is about to be submitted. The @request
+ * argument passed contains information about the text fields of the form. This
+ * is typically used to store login information that can be used later to
+ * pre-fill the form.
+ * The form will not be submitted until webkit_form_submission_request_submit() is called.
+ *
+ * It is possible to handle the form submission request asynchronously, by
+ * simply calling g_object_ref() on the @request argument and calling
+ * webkit_form_submission_request_submit() when done to continue with the form submission.
+ * If the last reference is removed on a #WebKitFormSubmissionRequest and the
+ * form has not been submitted, webkit_form_submission_request_submit() will be called.
+ */
+ signals[SUBMIT_FORM] =
+ g_signal_new("submit-form",
+ G_TYPE_FROM_CLASS(webViewClass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(WebKitWebViewClass, submit_form),
+ 0, 0,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ WEBKIT_TYPE_FORM_SUBMISSION_REQUEST);
}
static bool updateReplaceContentStatus(WebKitWebView* webView, WebKitLoadEvent loadEvent)
@@ -1250,7 +1281,7 @@ void webkitWebViewResourceLoadStarted(WebKitWebView* webView, WKFrameRef wkFrame
WebKitWebViewPrivate* priv = webView->priv;
WebKitWebResource* resource = webkitWebResourceCreate(wkFrame, request, isMainResource);
- if (WKFrameIsMainFrame(wkFrame) && isMainResource)
+ if (WKFrameIsMainFrame(wkFrame) && (isMainResource || !priv->mainResource))
priv->mainResource = resource;
priv->loadingResourcesMap.set(resourceIdentifier, adoptGRef(resource));
g_signal_emit(webView, signals[RESOURCE_LOAD_STARTED], 0, resource, request);
@@ -1388,6 +1419,11 @@ void webkitWebViewPopulateContextMenu(WebKitWebView* webView, WKArrayRef wkPropo
webkit_context_menu_remove_all(contextMenu.get());
}
+void webkitWebViewSubmitFormRequest(WebKitWebView* webView, WebKitFormSubmissionRequest* request)
+{
+ g_signal_emit(webView, signals[SUBMIT_FORM], 0, request);
+}
+
/**
* webkit_web_view_new:
*