summaryrefslogtreecommitdiff
path: root/Source/WebKit/gtk/webkit/webkitwebframe.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebKit/gtk/webkit/webkitwebframe.cpp
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebKit/gtk/webkit/webkitwebframe.cpp')
-rw-r--r--Source/WebKit/gtk/webkit/webkitwebframe.cpp135
1 files changed, 131 insertions, 4 deletions
diff --git a/Source/WebKit/gtk/webkit/webkitwebframe.cpp b/Source/WebKit/gtk/webkit/webkitwebframe.cpp
index 0ccddd1cd..4de192704 100644
--- a/Source/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -28,7 +28,6 @@
#include "webkitwebframe.h"
#include "AXObjectCache.h"
-#include "AccessibilityObjectWrapperAtk.h"
#include "AnimationController.h"
#include "DOMObjectCache.h"
#include "DocumentFragment.h"
@@ -41,6 +40,7 @@
#include "FrameView.h"
#include "GCController.h"
#include "GraphicsContext.h"
+#include "GtkUtilities.h"
#include "GtkVersioning.h"
#include "HTMLFrameOwnerElement.h"
#include "JSDOMBinding.h"
@@ -55,15 +55,18 @@
#include "ScriptController.h"
#include "SubstituteData.h"
#include "TextIterator.h"
+#include "WebKitAccessibleWrapperAtk.h"
#include "markup.h"
#include "webkit/WebKitDOMRangePrivate.h"
#include "webkitenumtypes.h"
#include "webkitglobalsprivate.h"
#include "webkitmarshal.h"
+#include "webkitnetworkresponse.h"
#include "webkitnetworkrequestprivate.h"
#include "webkitnetworkresponseprivate.h"
#include "webkitsecurityoriginprivate.h"
#include "webkitwebframeprivate.h"
+#include "webkitwebresource.h"
#include "webkitwebview.h"
#include "webkitwebviewprivate.h"
#include <JavaScriptCore/APICast.h>
@@ -104,6 +107,13 @@ enum {
TITLE_CHANGED,
HOVERING_OVER_LINK,
SCROLLBARS_POLICY_CHANGED,
+ // Resource loading signals
+ RESOURCE_REQUEST_STARTING,
+ RESOURCE_RESPONSE_RECEIVED,
+ RESOURCE_LOAD_FINISHED,
+ RESOURCE_CONTENT_LENGTH_RECEIVED,
+ RESOURCE_LOAD_FAILED,
+
LAST_SIGNAL
};
@@ -301,6 +311,124 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
webkit_marshal_BOOLEAN__VOID,
G_TYPE_BOOLEAN, 0);
+
+ /**
+ * WebKitWebFrame::resource-request-starting:
+ * @web_frame: the #WebKitWebFrame whose load dispatched this request
+ * @web_resource: an empty #WebKitWebResource object
+ * @request: the #WebKitNetworkRequest that will be dispatched
+ * @response: the #WebKitNetworkResponse representing the redirect
+ * response, if any
+ *
+ * Emitted when a request is about to be sent. You can modify the
+ * request while handling this signal. You can set the URI in the
+ * #WebKitNetworkRequest object itself, and add/remove/replace
+ * headers using the #SoupMessage object it carries, if it is
+ * present. See webkit_network_request_get_message(). Setting the
+ * request URI to "about:blank" will effectively cause the request
+ * to load nothing, and can be used to disable the loading of
+ * specific resources.
+ *
+ * Notice that information about an eventual redirect is available
+ * in @response's #SoupMessage, not in the #SoupMessage carried by
+ * the @request. If @response is %NULL, then this is not a
+ * redirected request.
+ *
+ * The #WebKitWebResource object will be the same throughout all
+ * the lifetime of the resource, but the contents may change
+ * between signal emissions.
+ *
+ * Since: 1.7.5
+ */
+ webkit_web_frame_signals[RESOURCE_REQUEST_STARTING] = g_signal_new("resource-request-starting",
+ G_TYPE_FROM_CLASS(frameClass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ 0, 0,
+ webkit_marshal_VOID__OBJECT_OBJECT_OBJECT,
+ G_TYPE_NONE, 3,
+ WEBKIT_TYPE_WEB_RESOURCE,
+ WEBKIT_TYPE_NETWORK_REQUEST,
+ WEBKIT_TYPE_NETWORK_RESPONSE);
+
+ /*
+ * WebKitWebFrame::resource-response-received
+ * @webFrame: the #WebKitWebFrame the response was received for
+ * @webResource: the #WebKitWebResource being loaded
+ * @response: the #WebKitNetworkResponse that was received.
+ *
+ * Emitted when the first byte of data arrives
+ *
+ * Since: 1.7.5
+ */
+ webkit_web_frame_signals[RESOURCE_RESPONSE_RECEIVED] = g_signal_new("resource-response-received",
+ G_TYPE_FROM_CLASS(frameClass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ 0, 0,
+ webkit_marshal_VOID__OBJECT_OBJECT,
+ G_TYPE_NONE, 2,
+ WEBKIT_TYPE_WEB_RESOURCE,
+ WEBKIT_TYPE_NETWORK_RESPONSE);
+
+ /*
+ * WebKitWebFrame::resource-load-finished
+ * @webFrame: the #WebKitWebFrame the response was received for
+ * @webResource: the #WebKitWebResource being loaded
+ *
+ * Emitted when all the data for the resource was loaded.
+ *
+ * Since: 1.7.5
+ */
+ webkit_web_frame_signals[RESOURCE_LOAD_FINISHED] = g_signal_new("resource-load-finished",
+ G_TYPE_FROM_CLASS(frameClass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ 0, 0,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ WEBKIT_TYPE_WEB_RESOURCE);
+
+ /*
+ * WebKitWebFrame::resource-content-length-received
+ * @webFrame: the #WebKitWebFrame the response was received for
+ * @webResource: the #WebKitWebResource that was loaded
+ * @lengthReceived: the resource data length in bytes
+ *
+ * Emitted when all the data for the resource was loaded.
+ *
+ * Since: 1.7.5
+ */
+ webkit_web_frame_signals[RESOURCE_CONTENT_LENGTH_RECEIVED] = g_signal_new("resource-content-length-received",
+ G_TYPE_FROM_CLASS(frameClass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ 0, 0,
+ webkit_marshal_VOID__OBJECT_INT,
+ G_TYPE_NONE, 2,
+ WEBKIT_TYPE_WEB_RESOURCE,
+ G_TYPE_INT);
+
+ /*
+ * WebKitWebFrame::resource-load-failed
+ * @webFrame: the #WebKitWebFrame the response was received for
+ * @webResource: the #WebKitWebResource that was loaded
+ * @webError: the #GError that was triggered
+ *
+ * Invoked when a resource failed to load.
+ *
+ * Since: 1.7.5
+ */
+ webkit_web_frame_signals[RESOURCE_LOAD_FAILED] = g_signal_new("resource-load-failed",
+ G_TYPE_FROM_CLASS(frameClass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ 0, 0,
+ webkit_marshal_VOID__OBJECT_POINTER,
+ G_TYPE_NONE, 2,
+ WEBKIT_TYPE_WEB_RESOURCE,
+ G_TYPE_POINTER);
+
/*
* implementations of virtual methods
*/
@@ -813,8 +941,7 @@ GtkPrintOperationResult webkit_web_frame_print_full(WebKitWebFrame* frame, GtkPr
g_return_val_if_fail(GTK_IS_PRINT_OPERATION(operation), GTK_PRINT_OPERATION_RESULT_ERROR);
GtkWidget* topLevel = gtk_widget_get_toplevel(GTK_WIDGET(webkit_web_frame_get_web_view(frame)));
-
- if (!gtk_widget_is_toplevel(topLevel))
+ if (!widgetIsOnscreenToplevelWindow(topLevel))
topLevel = 0;
Frame* coreFrame = core(frame);
@@ -853,7 +980,7 @@ void webkit_web_frame_print(WebKitWebFrame* frame)
if (error) {
GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(priv->webView));
- GtkWidget* dialog = gtk_message_dialog_new(gtk_widget_is_toplevel(window) ? GTK_WINDOW(window) : 0,
+ GtkWidget* dialog = gtk_message_dialog_new(widgetIsOnscreenToplevelWindow(window) ? GTK_WINDOW(window) : 0,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,