[EFL] Emit "resource,request,willsend" from ewk_view.
authorkubo@profusion.mobi <kubo@profusion.mobi@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 15:02:37 +0000 (15:02 +0000)
committerkubo@profusion.mobi <kubo@profusion.mobi@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 15:02:37 +0000 (15:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76292

Reviewed by Andreas Kling.

Make ewk_view dispatch the "resource,request,willsend" signal as well,
so that it is possible to know whether the request is for the main
frame itself or for anything else.

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::dispatchWillSendRequest):
* ewk/ewk_view.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105152 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
Source/WebKit/efl/ewk/ewk_view.h

index d215041..2746dde 100644 (file)
@@ -1,3 +1,18 @@
+2012-01-13  Raphael Kubo da Costa  <kubo@profusion.mobi>
+
+        [EFL] Emit "resource,request,willsend" from ewk_view.
+        https://bugs.webkit.org/show_bug.cgi?id=76292
+
+        Reviewed by Andreas Kling.
+
+        Make ewk_view dispatch the "resource,request,willsend" signal as well,
+        so that it is possible to know whether the request is for the main
+        frame itself or for anything else.
+
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::dispatchWillSendRequest):
+        * ewk/ewk_view.h:
+
 2012-01-16  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Build fix when using pango as font backends.
index 37c738c..1d4d64a 100644 (file)
@@ -172,6 +172,15 @@ void FrameLoaderClientEfl::dispatchWillSendRequest(DocumentLoader* loader, unsig
 
     ewk_frame_request_will_send(m_frame, &request);
 
+    // We want to distinguish between a request for a document to be loaded into
+    // the main frame, a sub-frame, or the sub-objects in that document (via Chromium).
+    if (loader) {
+        const FrameLoader* frameLoader = loader->frameLoader();
+        const bool isMainFrameRequest = (loader == frameLoader->provisionalDocumentLoader() && frameLoader->isLoadingMainFrame());
+        if (isMainFrameRequest)
+            evas_object_smart_callback_call(m_view, "resource,request,willsend", &request);
+    }
+
     if (request.url != orig.url) {
         coreRequest.setURL(KURL(KURL(), request.url));
 
index d0be61d..a433537 100644 (file)
@@ -61,6 +61,7 @@
  *  - "mixedcontent,displayed", void: any of the containing frames has loaded and displayed mixed content.
  *  - "mixedcontent,run", void: any of the containing frames has loaded and run mixed content.
  *  - "ready", void: page is fully loaded.
+ *  - "resource,request,willsend", Ewk_Frame_Resource_Request*: the network request for the main frame will be sent.
  *  - "scrollbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if scrollbars
  *    are visible; @c EINA_FALSE, otherwise.
  *  - "scrollbars,visible,set", Eina_Bool: sets scrollbars visibility.