[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:55:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 00bbec482c2da1f14e324bac9b9e11c5cdc280a4
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 11 17:14:54 2010 +0000

    2010-08-11  Ryuan Choi  <ryuan.choi at samsung.com>
    
            Reviewed by Antonio Gomes.
    
            Implementation dispatchDecidePolicyForNavigationAction
            https://bugs.webkit.org/show_bug.cgi?id=43544
    
            Add ewk_view_navigation_policy_decision to decide whether url which
            user clicked will be loaded or not.
    
            * WebCoreSupport/FrameLoaderClientEfl.cpp:
            (WebCore::FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction):
            * ewk/ewk_private.h:
            * ewk/ewk_view.cpp:
            (ewk_view_navigation_policy_decision):
            * ewk/ewk_view.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65163 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index 02c96ee..91e54b3 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-11  Ryuan Choi  <ryuan.choi at samsung.com>
+
+        Reviewed by Antonio Gomes.
+
+        Implementation dispatchDecidePolicyForNavigationAction
+        https://bugs.webkit.org/show_bug.cgi?id=43544
+
+        Add ewk_view_navigation_policy_decision to decide whether url which
+        user clicked will be loaded or not.
+
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction):
+        * ewk/ewk_private.h:
+        * ewk/ewk_view.cpp:
+        (ewk_view_navigation_policy_decision):
+        * ewk/ewk_view.h:
+
 2010-08-10  Ryuan Choi  <ryuan.choi at samsung.com>
 
         Unreviewed build fix.
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 5648ec7..499d6c2 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -354,9 +354,22 @@ void FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction(FramePolicyFu
     ASSERT(m_frame);
     // if not acceptNavigationRequest - look at Qt -> PolicyIgnore;
     // FIXME: do proper check and only reset forms when on PolicyIgnore
-    Frame* f = ewk_frame_core_get(m_frame);
-    f->loader()->resetMultipleFormSubmissionProtection();
-    callPolicyFunction(function, PolicyUse);
+    char* url = strdup(resourceRequest.url().prettyURL().utf8().data());
+    Ewk_Frame_Resource_Request request = { url, 0 };
+    Eina_Bool ret = ewk_view_navigation_policy_decision(m_view, &request);
+    free(url);
+
+    PolicyAction policy;
+    if (!ret)
+        policy = PolicyIgnore;
+    else {
+        if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted) {
+            Frame* f = ewk_frame_core_get(m_frame);
+            f->loader()->resetMultipleFormSubmissionProtection();
+        }
+        policy = PolicyUse;
+    }
+    callPolicyFunction(function, policy);
 }
 
 PassRefPtr<Widget> FrameLoaderClientEfl::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index f69f46c..eaad13c 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -148,6 +148,8 @@ void ewk_frame_force_layout(Evas_Object *o);
 
 WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually);
 
+Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request);
+
 #ifdef __cplusplus
 
 }
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index f6310d5..4cb1af7 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -3980,3 +3980,23 @@ Eina_Bool ewk_view_user_scalable_get(Evas_Object* o)
 
     return priv->settings.zoom_range.user_scalable;
 }
+
+/**
+ * @internal
+ * Reports a requeset will be loaded. It's client responsibility to decide if
+ * request would be used. If @return is true, loader will try to load. Else,
+ * Loader ignore action of request.
+ *
+ * @param o View to load
+ * @param request Request which contain url to navigate
+ */
+Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_TRUE);
+    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_TRUE);
+
+    if (!sd->api->navigation_policy_decision)
+        return EINA_TRUE;
+
+    return sd->api->navigation_policy_decision(sd, request);
+}
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index 19a3588..a68a768 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -21,6 +21,7 @@
 #ifndef ewk_view_h
 #define ewk_view_h
 
+#include "ewk_frame.h"
 #include "ewk_history.h"
 #include "ewk_window_features.h"
 
@@ -133,6 +134,8 @@ struct _Ewk_View_Smart_Class {
     uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
 
     Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
+
+    Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request);
 };
 
 #define EWK_VIEW_SMART_CLASS_VERSION 1UL /** the version you have to put into the version field in the Ewk_View_Smart_Class structure */

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list