wxgtk_webview_webkit_navigation(WebKitWebView*,
WebKitWebFrame *frame,
WebKitNetworkRequest *request,
- WebKitWebNavigationAction*,
+ WebKitWebNavigationAction *,
WebKitWebPolicyDecision *policy_decision,
wxWebViewWebKit *webKitCtrl)
{
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;
}
+static void
+wxgtk_webview_webkit_title_changed(WebKitWebView *webView,
+ WebKitWebFrame *frame,
+ gchar *title,
+ wxWebViewWebKit *webKitCtrl)
+{
+ wxWebNavigationEvent thisEvent(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
+ webKitCtrl->GetId(),
+ webKitCtrl->GetCurrentURL(),
+ "",
+ true);
+ thisEvent.SetString(wxString(title, wxConvUTF8));
+
+ if (webKitCtrl && webKitCtrl->GetEventHandler())
+ webKitCtrl->GetEventHandler()->ProcessEvent(thisEvent);
+
+}
+
} // extern "C"
//-----------------------------------------------------------------------------
g_signal_connect_after(web_view, "new-window-policy-decision-requested",
G_CALLBACK(wxgtk_webview_webkit_new_window), this);
+ g_signal_connect_after(web_view, "title-changed",
+ G_CALLBACK(wxgtk_webview_webkit_title_changed), this);
+
m_parent->DoAddChild( this );
PostCreation(size);