WebKit Bugzilla
Attachment 21288 Details for
Bug 16562
: [gtk] Implement WebPolicyDelegate methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Implement WebPolicyDelegate methods
policy-implementation.patch (text/plain), 40.58 KB, created by
Marco Barisione
on 2008-05-22 04:24:06 PDT
(
hide
)
Description:
Implement WebPolicyDelegate methods
Filename:
MIME Type:
Creator:
Marco Barisione
Created:
2008-05-22 04:24:06 PDT
Size:
40.58 KB
patch
obsolete
>diff --git a/ChangeLog b/ChangeLog >index dbcf9c5..9f0bf40 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,15 @@ >+2008-05-22 Marco Barisione <marco.barisione@collabora.co.uk> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ http://bugs.webkit.org/show_bug.cgi?id=16562 >+ [gtk] Implement WebPolicyDelegate methods >+ >+ * GNUmakefile.am: Add WebKit/gtk/webkit/webkitwebpolicydecision.h, >+ WebKit/gtk/webkit/webkitwebpolicydecision.cpp, >+ WebKit/gtk/webkit/webkitwebnavigationaction.h and >+ WebKit/gtk/webkit/webkitwebnavigationaction.cpp. >+ > 2008-05-20 Jan Michael Alonzo <jmalonzo@webkit.org> > > Reviewed by Alp Toker. >diff --git a/GNUmakefile.am b/GNUmakefile.am >index 9e32703..610dcca 100644 >--- a/GNUmakefile.am >+++ b/GNUmakefile.am >@@ -299,6 +299,8 @@ webkitgtk_h_api += \ > WebKit/gtk/webkit/webkitwebbackforwardlist.h \ > WebKit/gtk/webkit/webkitwebframe.h \ > WebKit/gtk/webkit/webkitwebhistoryitem.h \ >+ WebKit/gtk/webkit/webkitwebnavigationaction.h \ >+ WebKit/gtk/webkit/webkitwebpolicydecision.h \ > WebKit/gtk/webkit/webkitwebsettings.h \ > WebKit/gtk/webkit/webkitwebview.h > >@@ -324,6 +326,8 @@ webkitgtk_sources += \ > WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \ > WebKit/gtk/webkit/webkitwebframe.cpp \ > WebKit/gtk/webkit/webkitwebhistoryitem.cpp \ >+ WebKit/gtk/webkit/webkitwebnavigationaction.cpp \ >+ WebKit/gtk/webkit/webkitwebpolicydecision.cpp \ > WebKit/gtk/webkit/webkitwebsettings.cpp \ > WebKit/gtk/webkit/webkitwebview.cpp \ > WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \ >diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog >index 155fddd..9dd9c11 100644 >--- a/WebKit/gtk/ChangeLog >+++ b/WebKit/gtk/ChangeLog >@@ -1,3 +1,67 @@ >+2008-05-22 Marco Barisione <marco.barisione@collabora.co.uk> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ http://bugs.webkit.org/show_bug.cgi?id=16562 >+ [gtk] Implement WebPolicyDelegate methods >+ >+ Original work by Pierre-Luc Beaudoin. >+ >+ This implements the delegates methods of WebPolicyDelegate. >+ Since Gtk+/C doesn't have delegate methods, I replaced them with >+ signals. Also, since WebPolicyDelegate only has 3 delegate, I added >+ them to the WebView instead of creating new GObject with only 3 >+ signals. >+ >+ A new object WebKitWebPolicyDecision allow the browser to delay its >+ response in certain cases. As commented in WebCore, redirection >+ navigation requests are one case where a response is required to be >+ sync (ie. decision must be sent before the end of signal). If a >+ decision come in late, assertions could happen. >+ Only one policy decision should be pending with this implementation. >+ Again this seems to be a limitation in WebCore. >+ >+ I copied the default behaviours described in WebPolicyDelegate on the >+ Mac port. >+ >+ * WebCoreSupport/FrameLoaderClientGtk.cpp: >+ (WebKit::FrameLoaderClient::FrameLoaderClient): >+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForMIMEType): >+ (WebKit::FrameLoaderClient::dispatchDecidePolicyForNavigationAction): >+ (WebKit::FrameLoaderClient::cancelPolicyCheck): >+ (WebKit::FrameLoaderClient::canShowMIMEType): >+ * WebCoreSupport/FrameLoaderClientGtk.h: >+ * webkit/webkit-marshal.list: >+ * webkit/webkit.h: >+ * webkit/webkitdefines.h: >+ * webkit/webkitprivate.cpp: >+ (WebKit::kit): >+ (WebKit::core): >+ * webkit/webkitprivate.h: >+ * webkit/webkitwebnavigationaction.cpp: Added. >+ (_WebKitWebNavigationActionPrivate::): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_property): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_set_property): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_init): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_finalize): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_class_init): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_reason): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_set_reason): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_get_original_uri): >+ (_WebKitWebNavigationActionPrivate::webkit_web_navigation_action_set_original_uri): >+ * webkit/webkitwebnavigationaction.h: Added. >+ * webkit/webkitwebpolicydecision.cpp: Added. >+ (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_class_init): >+ (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_init): >+ (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_new): >+ (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_use): >+ (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_ignore): >+ (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_download): >+ (_WebKitWebPolicyDecisionPrivate::webkit_web_policy_decision_cancel): >+ * webkit/webkitwebpolicydecision.h: Added. >+ * webkit/webkitwebview.cpp: >+ * webkit/webkitwebview.h: >+ > 2008-05-19 Alp Toker <alp@nuanti.com> > > Reviewed by Anders and Beth. >diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp >index 4b746f5..bf7350f 100644 >--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp >+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp >@@ -44,6 +44,8 @@ > #include "kjs_proxy.h" > #include "webkitwebview.h" > #include "webkitwebframe.h" >+#include "webkitwebnavigationaction.h" >+#include "webkitwebpolicydecision.h" > #include "webkitprivate.h" > > #include <JavaScriptCore/APICast.h> >@@ -60,6 +62,7 @@ FrameLoaderClient::FrameLoaderClient(WebKitWebFrame* frame) > : m_frame(frame) > , m_pluginView(0) > , m_userAgent("") >+ , m_policyDecision(NULL) > { > ASSERT(m_frame); > } >@@ -242,16 +245,38 @@ void FrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader*, unsigned lon > m_response = response; > } > >-void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String&, const ResourceRequest&) >+void FrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String& mimeType, const ResourceRequest& resourceRequest) > { >- // FIXME: we need to call directly here (comment copied from Qt version) > ASSERT(policyFunction); > if (!policyFunction) > return; >- (core(m_frame)->loader()->*policyFunction)(PolicyUse); >+ >+ WebKitWebView* page = getViewFromFrame(m_frame); >+ WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data()); >+ WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction); >+ m_policyDecision = policyDecision; >+ >+ gboolean isHandled = false; >+ g_signal_emit_by_name(page, "mime-type-policy-decision-requested", m_frame, request, mimeType.utf8().data(), policyDecision, &isHandled); >+ >+ g_object_unref(request); >+ >+ if (isHandled) >+ return; >+ >+ PolicyAction policyResult; >+ >+ if (resourceRequest.url().isLocalFile()) >+ policyResult = PolicyUse; >+ else if (canShowMIMEType(mimeType)) >+ policyResult = PolicyUse; >+ else >+ policyResult = PolicyIgnore; >+ >+ (core(m_frame)->loader()->*policyFunction)(policyResult); > } > >-void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction&, const ResourceRequest&, const String&) >+void FrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction& action, const ResourceRequest& resourceRequest, const String& s) > { > ASSERT(policyFunction); > if (!policyFunction) >@@ -269,17 +294,25 @@ void FrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunct > > WebKitWebView* webView = getViewFromFrame(m_frame); > WebKitNetworkRequest* request = webkit_network_request_new(resourceRequest.url().string().utf8().data()); >- WebKitNavigationResponse response; >+ WebKitWebPolicyDecision* policyDecision = webkit_web_policy_decision_new(m_frame, policyFunction); >+ m_policyDecision = policyDecision; >+ >+ // TODO: use action.event(). >+ gpointer navigationAction = g_object_new(WEBKIT_TYPE_WEB_NAVIGATION_ACTION, >+ "reason", kit(action.type()), >+ "original-uri", action.url().string().utf8().data(), >+ NULL); > >- g_signal_emit_by_name(webView, "navigation-requested", m_frame, request, &response); >+ gboolean isHandled = false; >+ g_signal_emit_by_name(webView, "navigation-requested", m_frame, request, navigationAction, policyDecision, &isHandled); > >+ g_object_unref(navigationAction); > g_object_unref(request); > >- if (response == WEBKIT_NAVIGATION_RESPONSE_IGNORE) { >- (core(m_frame)->loader()->*policyFunction)(PolicyIgnore); >+ if (isHandled) > return; >- } > >+ // FIXME Implement default behavior when we can query the backend what protocols it supports > (core(m_frame)->loader()->*policyFunction)(PolicyUse); > } > >@@ -564,7 +597,9 @@ void FrameLoaderClient::dispatchShow() > > void FrameLoaderClient::cancelPolicyCheck() > { >- notImplemented(); >+ //FIXME Add support for more than one policy decision at once >+ if (m_policyDecision) >+ webkit_web_policy_decision_cancel(m_policyDecision); > } > > void FrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader*) >@@ -593,10 +628,10 @@ bool FrameLoaderClient::canHandleRequest(const ResourceRequest&) const > return true; > } > >-bool FrameLoaderClient::canShowMIMEType(const String&) const >+bool FrameLoaderClient::canShowMIMEType(const String& type) const > { >- notImplemented(); >- return true; >+ return MIMETypeRegistry::isSupportedImageMIMEType(type) || MIMETypeRegistry::isSupportedNonImageMIMEType(type) || >+ PluginDatabase::installedPlugins()->isMIMETypeRegistered(type); > } > > bool FrameLoaderClient::representationExistsForURLScheme(const String&) const >diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h >index f2dc696..c7e6504 100644 >--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h >+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h >@@ -33,6 +33,7 @@ > #include "FrameLoaderClient.h" > #include "ResourceResponse.h" > #include "PluginView.h" >+#include "webkitwebpolicydecision.h" > > typedef struct _WebKitWebFrame WebKitWebFrame; > >@@ -172,6 +173,7 @@ namespace WebKit { > WebKitWebFrame* m_frame; > WebCore::ResourceResponse m_response; > WebCore::String m_userAgent; >+ WebKitWebPolicyDecision* m_policyDecision; > > // Plugin view to redirect data to > WebCore::PluginView* m_pluginView; >diff --git a/WebKit/gtk/webkit/webkit-marshal.list b/WebKit/gtk/webkit/webkit-marshal.list >index a8f2453..2a29ee8 100644 >--- a/WebKit/gtk/webkit/webkit-marshal.list >+++ b/WebKit/gtk/webkit/webkit-marshal.list >@@ -9,4 +9,5 @@ BOOLEAN:STRING,INT,STRING > BOOLEAN:OBJECT,STRING > BOOLEAN:OBJECT,STRING,BOOLEAN > BOOLEAN:OBJECT,STRING,STRING,STRING >-INT:OBJECT,OBJECT >+BOOLEAN:OBJECT,OBJECT,STRING,OBJECT >+BOOLEAN:OBJECT,OBJECT,OBJECT,OBJECT >diff --git a/WebKit/gtk/webkit/webkit.h b/WebKit/gtk/webkit/webkit.h >index c929a89..9009eff 100644 >--- a/WebKit/gtk/webkit/webkit.h >+++ b/WebKit/gtk/webkit/webkit.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2007 Alp Toker <alp@atoker.com> >+ * Copyright (C) 2008 Collabora Ltd. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -27,6 +28,8 @@ > #include <webkit/webkitwebview.h> > #include <webkit/webkitwebbackforwardlist.h> > #include <webkit/webkitwebhistoryitem.h> >+#include <webkit/webkitwebpolicydecision.h> >+#include <webkit/webkitwebnavigationaction.h> > #include <webkit/webkit-enum-types.h> > > #endif /* __WEBKIT_H__ */ >diff --git a/WebKit/gtk/webkit/webkitdefines.h b/WebKit/gtk/webkit/webkitdefines.h >index 386c3e1..9699743 100644 >--- a/WebKit/gtk/webkit/webkitdefines.h >+++ b/WebKit/gtk/webkit/webkitdefines.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2007 Holger Hans Peter Freyther >+ * Copyright (C) 2008 Collabora Ltd. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -52,6 +53,9 @@ typedef struct _WebKitWebHistoryItemClass WebKitWebHistoryItemClass; > typedef struct _WebKitWebFrame WebKitWebFrame; > typedef struct _WebKitWebFrameClass WebKitWebFrameClass; > >+typedef struct _WebKitWebPolicyDecision WebKitWebPolicyDecision; >+typedef struct _WebKitWebPolicyDecisionClass WebKitWebPolicyDecisionClass; >+ > typedef struct _WebKitWebSettings WebKitWebSettings; > typedef struct _WebKitWebSettingsClass WebKitWebSettingsClass; > >diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp >index bea1ad6..59de813 100644 >--- a/WebKit/gtk/webkit/webkitprivate.cpp >+++ b/WebKit/gtk/webkit/webkitprivate.cpp >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2007 Holger Hans Peter Freyther >+ * Copyright (C) 2008 Collabora Ltd. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -83,6 +84,16 @@ WebKitWebView* kit(WebCore::Page* corePage) > return client ? client->webView() : 0; > } > >+WebKitWebNavigationReason kit(WebCore::NavigationType type) >+{ >+ return (WebKitWebNavigationReason)type; >+} >+ >+WebCore::NavigationType core(WebKitWebNavigationReason type) >+{ >+ return (WebCore::NavigationType)type; >+} >+ > } /** end namespace WebCore */ > > void webkit_init() >diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h >index 1d82578..102ae1d 100644 >--- a/WebKit/gtk/webkit/webkitprivate.h >+++ b/WebKit/gtk/webkit/webkitprivate.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2007, 2008 Holger Hans Peter Freyther > * Copyright (C) 2008 Jan Michael C. Alonzo >+ * Copyright (C) 2008 Collabora Ltd. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -29,6 +30,8 @@ > #include <webkit/webkitdefines.h> > #include <webkit/webkitwebview.h> > #include <webkit/webkitwebframe.h> >+#include <webkit/webkitwebpolicydecision.h> >+#include <webkit/webkitwebnavigationaction.h> > #include <webkit/webkitwebsettings.h> > #include <webkit/webkitwebbackforwardlist.h> > >@@ -54,6 +57,9 @@ namespace WebKit { > WebKitWebHistoryItem* kit(WebCore::HistoryItem*); > > WebCore::BackForwardList* core(WebKitWebBackForwardList*); >+ >+ WebKitWebNavigationReason kit(WebCore::NavigationType type); >+ WebCore::NavigationType core(WebKitWebNavigationReason reason); > } > > extern "C" { >@@ -108,6 +114,10 @@ extern "C" { > WebKitWebHistoryItem* > webkit_web_history_item_new_with_core_item(WebCore::HistoryItem*); > >+ WebKitWebPolicyDecision* webkit_web_policy_decision_new (WebKitWebFrame*, WebCore::FramePolicyFunction); >+ >+ void webkit_web_policy_decision_cancel (WebKitWebPolicyDecision* decision); >+ > // FIXME: Move these to webkitwebframe.h once their API has been discussed. > > WEBKIT_API GSList* >diff --git a/WebKit/gtk/webkit/webkitwebnavigationaction.cpp b/WebKit/gtk/webkit/webkitwebnavigationaction.cpp >new file mode 100644 >index 0000000..2a4dab9 >--- /dev/null >+++ b/WebKit/gtk/webkit/webkitwebnavigationaction.cpp >@@ -0,0 +1,195 @@ >+/* >+ * Copyright (C) 2008 Collabora Ltd. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+ >+#include "webkitwebnavigationaction.h" >+#include "webkitprivate.h" >+#include "webkit-enum-types.h" >+ >+#include <string.h> >+ >+extern "C" { >+ >+struct _WebKitWebNavigationActionPrivate { >+ WebKitWebNavigationReason reason; >+ gchar* originalUri; >+}; >+ >+#define WEBKIT_WEB_NAVIGATION_ACTION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionPrivate)) >+ >+enum { >+ PROP_0, >+ >+ PROP_REASON, >+ PROP_ORIGINAL_URI >+}; >+ >+G_DEFINE_TYPE(WebKitWebNavigationAction, webkit_web_navigation_action, G_TYPE_OBJECT) >+ >+ >+static void webkit_web_navigation_action_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) >+{ >+ WebKitWebNavigationAction* navigationAction = WEBKIT_WEB_NAVIGATION_ACTION(object); >+ >+ switch(propertyId) { >+ case PROP_REASON: >+ g_value_set_enum(value, webkit_web_navigation_action_get_reason(navigationAction)); >+ break; >+ case PROP_ORIGINAL_URI: >+ g_value_set_string(value, webkit_web_navigation_action_get_original_uri(navigationAction)); >+ break; >+ default: >+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); >+ break; >+ } >+} >+ >+static void webkit_web_navigation_action_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec) >+{ >+ WebKitWebNavigationAction* navigationAction = WEBKIT_WEB_NAVIGATION_ACTION(object); >+ >+ switch(propertyId) { >+ case PROP_REASON: >+ webkit_web_navigation_action_set_reason(navigationAction, (WebKitWebNavigationReason)g_value_get_enum(value)); >+ break; >+ case PROP_ORIGINAL_URI: >+ webkit_web_navigation_action_set_original_uri(navigationAction, g_value_get_string(value)); >+ break; >+ default: >+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); >+ break; >+ } >+} >+ >+static void webkit_web_navigation_action_init(WebKitWebNavigationAction* navigationAction) >+{ >+ navigationAction->priv = WEBKIT_WEB_NAVIGATION_ACTION_GET_PRIVATE(navigationAction); >+ >+ WebKitWebNavigationActionPrivate* priv = navigationAction->priv; >+ priv->originalUri = g_strdup(""); >+} >+ >+static void webkit_web_navigation_action_finalize(GObject* obj) >+{ >+ WebKitWebNavigationAction* navigationAction = WEBKIT_WEB_NAVIGATION_ACTION(obj); >+ WebKitWebNavigationActionPrivate* priv = navigationAction->priv; >+ >+ g_free(priv->originalUri); >+ >+ G_OBJECT_CLASS(webkit_web_navigation_action_parent_class)->finalize(obj); >+} >+ >+static void webkit_web_navigation_action_class_init(WebKitWebNavigationActionClass* requestClass) >+{ >+ GObjectClass* objectClass = G_OBJECT_CLASS(requestClass); >+ >+ objectClass->get_property = webkit_web_navigation_action_get_property; >+ objectClass->set_property = webkit_web_navigation_action_set_property; >+ objectClass->dispose = webkit_web_navigation_action_finalize; >+ >+ g_object_class_install_property(objectClass, PROP_REASON, >+ g_param_spec_enum("reason", >+ "Reason", >+ "The reason why this navigation is occurring", >+ WEBKIT_TYPE_WEB_NAVIGATION_REASON, >+ WEBKIT_WEB_NAVIGATION_REASON_OTHER, >+ (GParamFlags)(WEBKIT_PARAM_READWRITE))); >+ >+ g_object_class_install_property(objectClass, PROP_ORIGINAL_URI, >+ g_param_spec_string("original-uri", >+ "Original URI", >+ "The URI that was requested as the target for the navigation", >+ "", >+ WEBKIT_PARAM_READWRITE)); >+ >+ g_type_class_add_private(requestClass, sizeof(WebKitWebNavigationActionPrivate)); >+} >+ >+/** >+ * webkit_web_navigation_action_get_reason: >+ * @navigationAction: a #WebKitWebNavigationAction >+ * >+ * Returns the reason why WebKit is requesting a navigation. >+ * >+ * Return value: a #WebKitWebNavigationReason >+ */ >+WebKitWebNavigationReason webkit_web_navigation_action_get_reason(WebKitWebNavigationAction* navigationAction) >+{ >+ g_return_val_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction), WEBKIT_WEB_NAVIGATION_REASON_OTHER); >+ >+ return navigationAction->priv->reason; >+} >+ >+/** >+ * webkit_web_navigation_action_set_reason: >+ * @navigationAction: a #WebKitWebNavigationAction >+ * @reason: a #WebKitWebNavigationReason >+ * >+ * Sets the reason why WebKit is requesting a navigation. >+ */ >+void webkit_web_navigation_action_set_reason(WebKitWebNavigationAction* navigationAction, WebKitWebNavigationReason reason) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction)); >+ >+ if (navigationAction->priv->reason == reason) >+ return; >+ >+ navigationAction->priv->reason = reason; >+ g_object_notify(G_OBJECT(navigationAction), "reason"); >+} >+ >+/** >+ * webkit_web_navigation_action_get_original_uri: >+ * @navigationAction: a #WebKitWebNavigationAction >+ * >+ * Returns the URI that was originally requested. This may differ from the >+ * navigation target, for instance because of a redirect. >+ * >+ * Return value: the originally requested URI >+ */ >+const gchar* webkit_web_navigation_action_get_original_uri(WebKitWebNavigationAction* navigationAction) >+{ >+ g_return_val_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction), NULL); >+ >+ return navigationAction->priv->originalUri; >+} >+ >+/** >+ * webkit_web_navigation_action_set_original_uri: >+ * @navigationAction: a #WebKitWebNavigationAction >+ * @originalUri: a URI >+ * >+ * Sets the URI that was originally requested. This may differ from the >+ * navigation target, for instance because of a redirect. >+ */ >+void webkit_web_navigation_action_set_original_uri(WebKitWebNavigationAction* navigationAction, const gchar* originalUri) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_NAVIGATION_ACTION(navigationAction)); >+ g_return_if_fail(originalUri); >+ >+ if (!strcmp(navigationAction->priv->originalUri, originalUri)) >+ return; >+ >+ g_free(navigationAction->priv->originalUri); >+ navigationAction->priv->originalUri = g_strdup(originalUri); >+ g_object_notify(G_OBJECT(navigationAction), "original-uri"); >+} >+ >+} >diff --git a/WebKit/gtk/webkit/webkitwebnavigationaction.h b/WebKit/gtk/webkit/webkitwebnavigationaction.h >new file mode 100644 >index 0000000..9b63bbf >--- /dev/null >+++ b/WebKit/gtk/webkit/webkitwebnavigationaction.h >@@ -0,0 +1,77 @@ >+/* >+ * Copyright (C) 2008 Collabora Ltd. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#ifndef WEBKIT_WEB_NAVIGATION_ACTION_H >+#define WEBKIT_WEB_NAVIGATION_ACTION_H >+ >+#include <glib-object.h> >+ >+#include <webkit/webkitdefines.h> >+ >+G_BEGIN_DECLS >+ >+// The order of this enum must be the same as NavigationType in FrameLoaderTypes.h >+typedef enum { >+ WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED, >+ WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED, >+ WEBKIT_WEB_NAVIGATION_REASON_BACK_FORWARD, >+ WEBKIT_WEB_NAVIGATION_REASON_RELOAD, >+ WEBKIT_WEB_NAVIGATION_REASON_FORM_RESUBMITTED, >+ WEBKIT_WEB_NAVIGATION_REASON_OTHER, >+ WEBKIT_WEB_NAVIGATION_REASON_PLUG_IN_REQUEST >+} WebKitWebNavigationReason; >+ >+#define WEBKIT_TYPE_WEB_NAVIGATION_ACTION (webkit_web_navigation_action_get_type()) >+#define WEBKIT_WEB_NAVIGATION_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationAction)) >+#define WEBKIT_WEB_NAVIGATION_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionClass)) >+#define WEBKIT_IS_WEB_NAVIGATION_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION)) >+#define WEBKIT_IS_WEB_NAVIGATION_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_NAVIGATION_ACTION)) >+#define WEBKIT_WEB_NAVIGATION_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_NAVIGATION_ACTION, WebKitWebNavigationActionClass)) >+ >+typedef struct _WebKitWebNavigationAction WebKitWebNavigationAction; >+typedef struct _WebKitWebNavigationActionClass WebKitWebNavigationActionClass; >+typedef struct _WebKitWebNavigationActionPrivate WebKitWebNavigationActionPrivate; >+ >+struct _WebKitWebNavigationAction { >+ GObject parent_instance; >+ WebKitWebNavigationActionPrivate* priv; >+}; >+ >+struct _WebKitWebNavigationActionClass { >+ GObjectClass parent_class; >+}; >+ >+WEBKIT_API GType >+webkit_web_navigation_action_get_type(void); >+ >+WEBKIT_API WebKitWebNavigationReason >+webkit_web_navigation_action_get_reason(WebKitWebNavigationAction* navigationAction); >+ >+WEBKIT_API void >+webkit_web_navigation_action_set_reason(WebKitWebNavigationAction* navigationAction, WebKitWebNavigationReason reason); >+ >+WEBKIT_API const gchar* >+webkit_web_navigation_action_get_original_uri(WebKitWebNavigationAction* navigationAction); >+ >+WEBKIT_API void >+webkit_web_navigation_action_set_original_uri(WebKitWebNavigationAction* navigationAction, const gchar* originalUri); >+ >+G_END_DECLS >+ >+#endif >diff --git a/WebKit/gtk/webkit/webkitwebpolicydecision.cpp b/WebKit/gtk/webkit/webkitwebpolicydecision.cpp >new file mode 100644 >index 0000000..9ba3276 >--- /dev/null >+++ b/WebKit/gtk/webkit/webkitwebpolicydecision.cpp >@@ -0,0 +1,123 @@ >+/* >+ * Copyright (C) 2008 Collabora Ltd. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+ >+#include "webkitwebpolicydecision.h" >+ >+#include "FrameLoaderTypes.h" >+#include "webkitprivate.h" >+ >+using namespace WebKit; >+using namespace WebCore; >+ >+extern "C" { >+ >+G_DEFINE_TYPE(WebKitWebPolicyDecision, webkit_web_policy_decision, G_TYPE_OBJECT); >+ >+struct _WebKitWebPolicyDecisionPrivate { >+ WebKitWebFrame* frame; >+ FramePolicyFunction framePolicyFunction; >+ gboolean isCancelled; >+}; >+ >+#define WEBKIT_WEB_POLICY_DECISION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionPrivate)) >+ >+static void webkit_web_policy_decision_class_init(WebKitWebPolicyDecisionClass* decisionClass) >+{ >+ g_type_class_add_private(decisionClass, sizeof(WebKitWebPolicyDecisionPrivate)); >+} >+ >+static void webkit_web_policy_decision_init(WebKitWebPolicyDecision* decision) >+{ >+ decision->priv = WEBKIT_WEB_POLICY_DECISION_GET_PRIVATE(decision); >+} >+ >+WebKitWebPolicyDecision* webkit_web_policy_decision_new(WebKitWebFrame* frame, WebCore::FramePolicyFunction function) >+{ >+ g_return_val_if_fail(frame, NULL); >+ >+ WebKitWebPolicyDecision* decision = WEBKIT_WEB_POLICY_DECISION(g_object_new(WEBKIT_TYPE_WEB_POLICY_DECISION, NULL)); >+ WebKitWebPolicyDecisionPrivate* priv = decision->priv; >+ >+ priv->frame = frame; >+ priv->framePolicyFunction = function; >+ priv->isCancelled = FALSE; >+ >+ return decision; >+} >+ >+/** >+ * webkit_web_policy_decision_use >+ * @decision: a #WebKitWebPolicyDecision >+ * >+ * Will send the USE decision to the policy implementer. >+ */ >+void webkit_web_policy_decision_use(WebKitWebPolicyDecision* decision) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision)); >+ >+ WebKitWebPolicyDecisionPrivate* priv = decision->priv; >+ >+ if (!priv->isCancelled) >+ (core(priv->frame)->loader()->*(priv->framePolicyFunction))(WebCore::PolicyUse); >+} >+ >+/** >+ * webkit_web_policy_decision_ignore >+ * @decision: a #WebKitWebPolicyDecision >+ * >+ * Will send the IGNORE decision to the policy implementer. >+ */ >+void webkit_web_policy_decision_ignore(WebKitWebPolicyDecision* decision) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision)); >+ >+ WebKitWebPolicyDecisionPrivate* priv = decision->priv; >+ >+ if (!priv->isCancelled) >+ (core(priv->frame)->loader()->*(priv->framePolicyFunction))(WebCore::PolicyIgnore); >+} >+ >+/** >+ * webkit_web_policy_decision_download >+ * @decision: a #WebKitWebPolicyDecision >+ * >+ * Will send the DOWNLOAD decision to the policy implementer. >+ */ >+void webkit_web_policy_decision_download(WebKitWebPolicyDecision* decision) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision)); >+ >+ WebKitWebPolicyDecisionPrivate* priv = decision->priv; >+ >+ if (!priv->isCancelled) >+ (core(priv->frame)->loader()->*(priv->framePolicyFunction))(WebCore::PolicyDownload); >+} >+ >+void webkit_web_policy_decision_cancel(WebKitWebPolicyDecision* decision) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_POLICY_DECISION(decision)); >+ >+ WebKitWebPolicyDecisionPrivate* priv = decision->priv; >+ >+ priv->isCancelled = TRUE; >+} >+ >+} >diff --git a/WebKit/gtk/webkit/webkitwebpolicydecision.h b/WebKit/gtk/webkit/webkitwebpolicydecision.h >new file mode 100644 >index 0000000..a9c04aa >--- /dev/null >+++ b/WebKit/gtk/webkit/webkitwebpolicydecision.h >@@ -0,0 +1,62 @@ >+/* >+ * Copyright (C) 2008 Collabora Ltd. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#ifndef WEBKIT_WEB_POLICY_DECISION_H >+#define WEBKIT_WEB_POLICY_DECISION_H >+ >+#include <config.h> >+ >+#include <glib-object.h> >+#include <stdint.h> >+#include "webkitdefines.h" >+ >+G_BEGIN_DECLS >+ >+#define WEBKIT_TYPE_WEB_POLICY_DECISION (webkit_web_policy_decision_get_type()) >+#define WEBKIT_WEB_POLICY_DECISION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecision)) >+#define WEBKIT_WEB_POLICY_DECISION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionClass)) >+#define WEBKIT_IS_WEB_POLICY_DECISION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_POLICY_DECISION)) >+#define WEBKIT_IS_WEB_POLICY_DECISION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_POLICY_DECISION)) >+#define WEBKIT_WEB_POLICY_DECISION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_POLICY_DECISION, WebKitWebPolicyDecisionClass)) >+ >+typedef struct _WebKitWebPolicyDecisionPrivate WebKitWebPolicyDecisionPrivate; >+struct _WebKitWebPolicyDecision { >+ GObject parent; >+ WebKitWebPolicyDecisionPrivate* priv; >+}; >+ >+struct _WebKitWebPolicyDecisionClass { >+ GObjectClass parent; >+}; >+ >+WEBKIT_API GType >+webkit_web_policy_decision_get_type (void); >+ >+WEBKIT_API void >+webkit_web_policy_decision_use (WebKitWebPolicyDecision* decision); >+ >+WEBKIT_API void >+webkit_web_policy_decision_ignore (WebKitWebPolicyDecision* decision); >+ >+WEBKIT_API void >+webkit_web_policy_decision_download (WebKitWebPolicyDecision* decision); >+ >+G_END_DECLS >+ >+#endif >diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp >index 9a06988..3a71920 100644 >--- a/WebKit/gtk/webkit/webkitwebview.cpp >+++ b/WebKit/gtk/webkit/webkitwebview.cpp >@@ -5,6 +5,7 @@ > * Copyright (C) 2007 Alp Toker <alp@atoker.com> > * Copyright (C) 2008 Jan Alonzo <jmalonzo@unpluggable.com> > * Copyright (C) 2008 Nuanti Ltd. >+ * Copyright (C) 2008 Collabora Ltd. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Lesser General Public >@@ -69,6 +70,7 @@ extern "C" { > enum { > /* normal signals */ > NAVIGATION_REQUESTED, >+ MIME_TYPE_POLICY_DECISION_REQUESTED, > WINDOW_OBJECT_CLEARED, > LOAD_STARTED, > LOAD_COMMITTED, >@@ -539,12 +541,6 @@ static WebKitWebView* webkit_web_view_real_create_web_view(WebKitWebView*) > return 0; > } > >-static WebKitNavigationResponse webkit_web_view_real_navigation_requested(WebKitWebView*, WebKitWebFrame* frame, WebKitNetworkRequest*) >-{ >- notImplemented(); >- return WEBKIT_NAVIGATION_RESPONSE_ACCEPT; >-} >- > static void webkit_web_view_real_window_object_cleared(WebKitWebView*, WebKitWebFrame*, JSGlobalContextRef context, JSObjectRef window_object) > { > notImplemented(); >@@ -705,18 +701,6 @@ static void webkit_web_view_finalize(GObject* object) > G_OBJECT_CLASS(webkit_web_view_parent_class)->finalize(object); > } > >-static gboolean webkit_navigation_request_handled(GSignalInvocationHint* ihint, GValue* returnAccu, const GValue* handlerReturn, gpointer dummy) >-{ >- gboolean continueEmission = TRUE; >- int signalHandled = g_value_get_int(handlerReturn); >- g_value_set_int(returnAccu, signalHandled); >- >- if (signalHandled != WEBKIT_NAVIGATION_RESPONSE_ACCEPT) >- continueEmission = FALSE; >- >- return continueEmission; >-} >- > static AtkObject* webkit_web_view_get_accessible(GtkWidget* widget) > { > WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); >@@ -747,16 +731,60 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) > * Signals > */ > >+ /** >+ * WebKitWebView::navigation-requested: >+ * @web_view: the object on which the signal is emitted >+ * @frame: the #WebKitWebFrame that required the navigation >+ * @request: a #WebKitNetworkRequest >+ * @navigation_action: a #WebKitWebNavigation >+ * @policy_decision: a #WebKitWebPolicyDecision >+ * @return: TRUE if the signal will be handled, >+ * FALSE to have the default behavior apply >+ * >+ * Emitted when @frame requests a navigation to another page. >+ * If this signal is not handled, the default behavior is to allow the >+ * navigation. >+ */ > webkit_web_view_signals[NAVIGATION_REQUESTED] = g_signal_new("navigation-requested", > G_TYPE_FROM_CLASS(webViewClass), > (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), >- G_STRUCT_OFFSET (WebKitWebViewClass, navigation_requested), >- webkit_navigation_request_handled, >+ 0, >+ g_signal_accumulator_true_handled, > NULL, >- webkit_marshal_INT__OBJECT_OBJECT, >- G_TYPE_INT, 2, >- G_TYPE_OBJECT, >- G_TYPE_OBJECT); >+ webkit_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT_OBJECT, >+ G_TYPE_BOOLEAN, 4, >+ WEBKIT_TYPE_WEB_FRAME, >+ WEBKIT_TYPE_NETWORK_REQUEST, >+ WEBKIT_TYPE_WEB_NAVIGATION_ACTION, >+ WEBKIT_TYPE_WEB_POLICY_DECISION); >+ >+ /** >+ * WebKitWebView::mime-type-policy-decision-requested: >+ * @web_view: the object on which the signal is emitted >+ * @frame: the #WebKitWebFrame that required the policy decision >+ * @request: a WebKitNetworkRequest >+ * @mimetype: the MIME type attempted to load >+ * @policy_decision: a #WebKitWebPolicyDecision >+ * @return: TRUE if the signal will be handled, >+ * FALSE to have the default behavior apply >+ * >+ * Decide whether or not to display of not the given MIME type. >+ * If this signal is not handled, the default behavior is to show the >+ * content of the requested URI if WebKit can show this MIME type, >+ * else it will be ignored. >+ */ >+ webkit_web_view_signals[MIME_TYPE_POLICY_DECISION_REQUESTED] = g_signal_new("mime-type-policy-decision-requested", >+ G_TYPE_FROM_CLASS(webViewClass), >+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), >+ 0, >+ g_signal_accumulator_true_handled, >+ NULL, >+ webkit_marshal_BOOLEAN__OBJECT_OBJECT_STRING_OBJECT, >+ G_TYPE_BOOLEAN, 4, >+ WEBKIT_TYPE_WEB_FRAME, >+ WEBKIT_TYPE_NETWORK_REQUEST, >+ G_TYPE_STRING, >+ WEBKIT_TYPE_WEB_POLICY_DECISION); > > /** > * WebKitWebView::window-object-cleared: >@@ -1074,7 +1102,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) > * implementations of virtual methods > */ > webViewClass->create_web_view = webkit_web_view_real_create_web_view; >- webViewClass->navigation_requested = webkit_web_view_real_navigation_requested; > webViewClass->window_object_cleared = webkit_web_view_real_window_object_cleared; > webViewClass->choose_file = webkit_web_view_real_choose_file; > webViewClass->script_alert = webkit_web_view_real_script_alert; >@@ -1993,6 +2020,27 @@ GtkTargetList* webkit_web_view_get_paste_target_list(WebKitWebView* webView) > } > > /** >+ * webkit_web_view_can_show_mime_type: >+ * @web_view: a #WebKitWebView >+ * @mime_type: a MIME type >+ * >+ * This functions returns whether or not a MIME type can be displayed using this view. >+ * >+ * Return value: a #gboolean indicating if the MIME type can be displayed >+ **/ >+ >+gboolean webkit_web_view_can_show_mime_type (WebKitWebView* webView, const gchar* mimeType) >+{ >+ g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); >+ >+ Frame* frame = core(webkit_web_view_get_main_frame(webView)); >+ if (FrameLoader* loader = frame->loader()) >+ return loader->canShowMIMEType(mimeType); >+ else >+ return FALSE; >+} >+ >+/** > * webkit_web_view_get_transparent: > * @web_view: a #WebKitWebView > * >diff --git a/WebKit/gtk/webkit/webkitwebview.h b/WebKit/gtk/webkit/webkitwebview.h >index 0c5a675..41f2dac 100644 >--- a/WebKit/gtk/webkit/webkitwebview.h >+++ b/WebKit/gtk/webkit/webkitwebview.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2007 Holger Hans Peter Freyther > * Copyright (C) 2007, 2008 Alp Toker <alp@atoker.com> >+ * Copyright (C) 2008 Collabora Ltd. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -40,12 +41,6 @@ G_BEGIN_DECLS > > typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate; > >-typedef enum { >- WEBKIT_NAVIGATION_RESPONSE_ACCEPT, >- WEBKIT_NAVIGATION_RESPONSE_IGNORE, >- WEBKIT_NAVIGATION_RESPONSE_DOWNLOAD >-} WebKitNavigationResponse; >- > typedef enum > { > WEBKIT_WEB_VIEW_TARGET_INFO_HTML = - 1, >@@ -69,11 +64,6 @@ struct _WebKitWebViewClass { > */ > WebKitWebView* (*create_web_view) (WebKitWebView* web_view); > >- /* >- * TODO: FIXME: Create something like WebPolicyDecisionListener_Protocol instead >- */ >- WebKitNavigationResponse (*navigation_requested) (WebKitWebView* web_view, WebKitWebFrame* frame, WebKitNetworkRequest* request); >- > void (*window_object_cleared) (WebKitWebView* web_view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef window_object); > gchar* (*choose_file) (WebKitWebView* web_view, WebKitWebFrame* frame, const gchar* old_file); > gboolean (*script_alert) (WebKitWebView* web_view, WebKitWebFrame* frame, const gchar* alert_message); >@@ -212,6 +202,9 @@ WEBKIT_OBSOLETE_API void > webkit_web_view_go_backward (WebKitWebView* web_view); > > WEBKIT_API gboolean >+webkit_web_view_can_show_mime_type (WebKitWebView* web_view, const gchar* mime_type); >+ >+WEBKIT_API gboolean > webkit_web_view_get_transparent (WebKitWebView* web_view); > > WEBKIT_API void
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 16562
:
18040
|
18276
|
18357
|
18372
|
18394
|
18579
|
18603
|
18970
|
18971
|
19530
|
21001
|
21288
|
23794
|
25924
|
26036
|
26149
|
26157