]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/webview_webkit.cpp
Initial implementation of wxWebProtocolHandler and wxWebFileProtocolHandler for the...
[wxWidgets.git] / src / gtk / webview_webkit.cpp
index 6e6096bf378061f2d79587854b01a2dc7f20b58c..27879488dfd335910ed958d816f54278067c60e7 100644 (file)
@@ -26,8 +26,9 @@ extern "C"
 {
 
 static void
-wxgtk_webkitctrl_load_status_callback(GtkWidget* widget, GParamSpec*,
-                                      wxWebViewWebKit *webKitCtrl)
+wxgtk_webview_webkit_load_status(GtkWidget* widget, 
+                                 GParamSpec*,
+                                 wxWebViewWebKit *webKitCtrl)
 {
     if (!webKitCtrl->m_ready) return;
 
@@ -95,11 +96,11 @@ wxgtk_webview_webkit_navigation(WebKitWebView*,
 }
 
 static gboolean
-wxgtk_webkitctrl_error (WebKitWebView*,
-                        WebKitWebFrame*,
-                        gchar          *uri,
-                        gpointer        web_error,
-                        wxWebViewWebKit* webKitWindow)
+wxgtk_webview_webkit_error(WebKitWebView*,
+                           WebKitWebFrame*,
+                           gchar *uri,
+                           gpointer web_error,
+                           wxWebViewWebKit* webKitWindow)
 {
     webKitWindow->m_busy = false;
     wxWebNavigationError type = wxWEB_NAV_ERR_OTHER;
@@ -238,12 +239,12 @@ wxgtk_webkitctrl_error (WebKitWebView*,
 }
 
 static gboolean
-wxgtk_webkitctrl_new_window(WebKitWebView*,
-                            WebKitWebFrame *frame,
-                            WebKitNetworkRequest *request,
-                            WebKitWebNavigationAction*,
-                            WebKitWebPolicyDecision *policy_decision,
-                    wxWebViewWebKit *webKitCtrl)
+wxgtk_webview_webkit_new_window(WebKitWebView*,
+                                WebKitWebFrame *frame,
+                                WebKitNetworkRequest *request,
+                                WebKitWebNavigationAction*,
+                                WebKitWebPolicyDecision *policy_decision,
+                                wxWebViewWebKit *webKitCtrl)
 {
     const gchar* uri = webkit_network_request_get_uri(request);
 
@@ -257,14 +258,8 @@ wxgtk_webkitctrl_new_window(WebKitWebView*,
     if (webKitCtrl && webKitCtrl->GetEventHandler())
         webKitCtrl->GetEventHandler()->ProcessEvent(thisEvent);
 
-    if (thisEvent.IsVetoed())
-    {
-        webkit_web_policy_decision_ignore(policy_decision);
-    }
-    else
-    {
-        webkit_web_policy_decision_use(policy_decision);
-    }
+    //We always want the user to handle this themselves
+    webkit_web_policy_decision_ignore(policy_decision);
     return TRUE;
 }
 
@@ -307,17 +302,17 @@ bool wxWebViewWebKit::Create(wxWindow *parent,
     gtk_widget_show(web_view);
 
     g_signal_connect_after(web_view, "notify::load-status",
-                           G_CALLBACK(wxgtk_webkitctrl_load_status_callback),
+                           G_CALLBACK(wxgtk_webview_webkit_load_status),
                            this);
     g_signal_connect_after(web_view, "navigation-policy-decision-requested",
                            G_CALLBACK(wxgtk_webview_webkit_navigation),
                            this);
     g_signal_connect_after(web_view, "load-error", 
-                           G_CALLBACK(wxgtk_webkitctrl_error),
+                           G_CALLBACK(wxgtk_webview_webkit_error),
                            this);
 
     g_signal_connect_after(web_view, "new-window-policy-decision-requested",
-                           G_CALLBACK(wxgtk_webkitctrl_new_window), this);
+                           G_CALLBACK(wxgtk_webview_webkit_new_window), this);
 
     m_parent->DoAddChild( this );