Changeset 65163 in webkit


Ignore:
Timestamp:
Aug 11, 2010 10:14:54 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-08-11 Ryuan Choi <ryuan.choi@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:
Location:
trunk/WebKit/efl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/efl/ChangeLog

    r65122 r65163  
     12010-08-11  Ryuan Choi  <ryuan.choi@samsung.com>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        Implementation dispatchDecidePolicyForNavigationAction
     6        https://bugs.webkit.org/show_bug.cgi?id=43544
     7
     8        Add ewk_view_navigation_policy_decision to decide whether url which
     9        user clicked will be loaded or not.
     10
     11        * WebCoreSupport/FrameLoaderClientEfl.cpp:
     12        (WebCore::FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction):
     13        * ewk/ewk_private.h:
     14        * ewk/ewk_view.cpp:
     15        (ewk_view_navigation_policy_decision):
     16        * ewk/ewk_view.h:
     17
    1182010-08-10  Ryuan Choi  <ryuan.choi@samsung.com>
    219
  • trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp

    r62787 r65163  
    355355    // if not acceptNavigationRequest - look at Qt -> PolicyIgnore;
    356356    // FIXME: do proper check and only reset forms when on PolicyIgnore
    357     Frame* f = ewk_frame_core_get(m_frame);
    358     f->loader()->resetMultipleFormSubmissionProtection();
    359     callPolicyFunction(function, PolicyUse);
     357    char* url = strdup(resourceRequest.url().prettyURL().utf8().data());
     358    Ewk_Frame_Resource_Request request = { url, 0 };
     359    Eina_Bool ret = ewk_view_navigation_policy_decision(m_view, &request);
     360    free(url);
     361
     362    PolicyAction policy;
     363    if (!ret)
     364        policy = PolicyIgnore;
     365    else {
     366        if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted) {
     367            Frame* f = ewk_frame_core_get(m_frame);
     368            f->loader()->resetMultipleFormSubmissionProtection();
     369        }
     370        policy = PolicyUse;
     371    }
     372    callPolicyFunction(function, policy);
    360373}
    361374
  • trunk/WebKit/efl/ewk/ewk_private.h

    r65021 r65163  
    149149WTF::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);
    150150
     151Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request);
     152
    151153#ifdef __cplusplus
    152154
  • trunk/WebKit/efl/ewk/ewk_view.cpp

    r65122 r65163  
    39813981    return priv->settings.zoom_range.user_scalable;
    39823982}
     3983
     3984/**
     3985 * @internal
     3986 * Reports a requeset will be loaded. It's client responsibility to decide if
     3987 * request would be used. If @return is true, loader will try to load. Else,
     3988 * Loader ignore action of request.
     3989 *
     3990 * @param o View to load
     3991 * @param request Request which contain url to navigate
     3992 */
     3993Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request)
     3994{
     3995    EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_TRUE);
     3996    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_TRUE);
     3997
     3998    if (!sd->api->navigation_policy_decision)
     3999        return EINA_TRUE;
     4000
     4001    return sd->api->navigation_policy_decision(sd, request);
     4002}
  • trunk/WebKit/efl/ewk/ewk_view.h

    r63978 r65163  
    2222#define ewk_view_h
    2323
     24#include "ewk_frame.h"
    2425#include "ewk_history.h"
    2526#include "ewk_window_features.h"
     
    134135
    135136    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);
     137
     138    Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request);
    136139};
    137140
Note: See TracChangeset for help on using the changeset viewer.