From 8f4747aa1731acf83f1bd7249b392d0cded08c4b Mon Sep 17 00:00:00 2001 From: Gustavo Noronha Silva Date: Wed, 14 Jan 2009 18:41:38 -0200 Subject: Provide API to loading using WebKitNetworkRequest As the first API adition to out WebKitWebView subclass, we allow Epiphany code to use a WebKitNetworkRequest to load pages. This way we can use the full request information, not just the URI. --- embed/ephy-web-view.c | 19 +++++++++++++++++++ embed/ephy-web-view.h | 3 +++ 2 files changed, 22 insertions(+) diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index f5a1dbf57..1aade87ee 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -55,3 +55,22 @@ ephy_web_view_new (void) return GTK_WIDGET (g_object_new (EPHY_TYPE_WEB_VIEW, NULL)); } +/** + * ephy_web_view_load_request: + * @web_view: the #EphyWebView in which to load the request + * @request: the #WebKitNetworkRequest to be loaded + * + * Loads the given #WebKitNetworkRequest in the given #EphyWebView. + **/ +void +ephy_web_view_load_request (EphyWebView *web_view, + WebKitNetworkRequest *request) +{ + WebKitWebFrame *main_frame; + + g_return_if_fail(EPHY_IS_WEB_VIEW(web_view)); + g_return_if_fail(WEBKIT_IS_NETWORK_REQUEST(request)); + + main_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW(web_view)); + webkit_web_frame_load_request(main_frame, request); +} diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h index 3fe9623bc..9fc31355e 100644 --- a/embed/ephy-web-view.h +++ b/embed/ephy-web-view.h @@ -60,6 +60,9 @@ GType ephy_web_view_get_type (void); GtkWidget *ephy_web_view_new (void); +void ephy_web_view_load_request (EphyWebView *web_view, + WebKitNetworkRequest *request); + G_END_DECLS #endif -- cgit