diff options
author | Xan Lopez <xan@gnome.org> | 2009-09-03 01:00:23 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-09-03 01:02:06 +0800 |
commit | 2836316f28b460a2b03c4ffb6c4991b6509f5f48 (patch) | |
tree | 47c7c1e262f84c746c371209abfa4412a6f4334f /embed/ephy-embed.c | |
parent | f64f922aebd3b14de4dfb3652d40c3d7c64c1069 (diff) | |
download | gsoc2013-epiphany-2836316f28b460a2b03c4ffb6c4991b6509f5f48.tar gsoc2013-epiphany-2836316f28b460a2b03c4ffb6c4991b6509f5f48.tar.gz gsoc2013-epiphany-2836316f28b460a2b03c4ffb6c4991b6509f5f48.tar.bz2 gsoc2013-epiphany-2836316f28b460a2b03c4ffb6c4991b6509f5f48.tar.lz gsoc2013-epiphany-2836316f28b460a2b03c4ffb6c4991b6509f5f48.tar.xz gsoc2013-epiphany-2836316f28b460a2b03c4ffb6c4991b6509f5f48.tar.zst gsoc2013-epiphany-2836316f28b460a2b03c4ffb6c4991b6509f5f48.zip |
ephy-embed.c: use the initial request to fill the URL entry
Avoids having a blank URL entry until the server responds to our
request.
Bug #591294
Diffstat (limited to 'embed/ephy-embed.c')
-rw-r--r-- | embed/ephy-embed.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 80fd0cd3b..1d5daa288 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -238,16 +238,20 @@ load_status_changed_cb (WebKitWebView *view, security_level = EPHY_WEB_VIEW_STATE_IS_UNKNOWN; ephy_web_view_set_security_level (EPHY_WEB_VIEW (view), security_level); - } else { + } else if (status == WEBKIT_LOAD_PROVISIONAL || status == WEBKIT_LOAD_FINISHED) { EphyWebViewNetState estate = EPHY_WEB_VIEW_STATE_UNKNOWN; - /* FIXME: this does not work for URLs opened without typing - (middle click, etc). We should use get_address, but WebKit does - not update its URI property until LOAD_COMMITTED, so we'll get - NULL here. We need to either change WebKit or fetch the address - we are trying to load from our side. */ - const char *loading_uri = ephy_web_view_get_typed_address (EPHY_WEB_VIEW (view)); + const char *loading_uri; if (status == WEBKIT_LOAD_PROVISIONAL) { + WebKitWebFrame *frame; + WebKitWebDataSource *source; + WebKitNetworkRequest *request; + + frame = webkit_web_view_get_main_frame (view); + source = webkit_web_frame_get_provisional_data_source (frame); + request = webkit_web_data_source_get_initial_request (source); + loading_uri = webkit_network_request_get_uri (request); + estate = (EphyWebViewNetState) (estate | EPHY_WEB_VIEW_STATE_START | EPHY_WEB_VIEW_STATE_NEGOTIATING | @@ -256,6 +260,8 @@ load_status_changed_cb (WebKitWebView *view, g_signal_emit_by_name (EPHY_WEB_VIEW (view), "new-document-now", loading_uri); } else if (status == WEBKIT_LOAD_FINISHED) { + loading_uri = ephy_web_view_get_address (EPHY_WEB_VIEW (view)); + estate = (EphyWebViewNetState) (estate | EPHY_WEB_VIEW_STATE_STOP | EPHY_WEB_VIEW_STATE_IS_DOCUMENT | |