diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-06-21 23:17:18 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-06-24 19:34:07 +0800 |
commit | ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9 (patch) | |
tree | 07aa4625ed0b1731c5ce4d95bf5d778cfefc02dd | |
parent | 64bc15de3f1dcbd68243f0544d0514ef341534b4 (diff) | |
download | gsoc2013-epiphany-ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9.tar gsoc2013-epiphany-ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9.tar.gz gsoc2013-epiphany-ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9.tar.bz2 gsoc2013-epiphany-ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9.tar.lz gsoc2013-epiphany-ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9.tar.xz gsoc2013-epiphany-ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9.tar.zst gsoc2013-epiphany-ccc2a6f6a9cfea8a06dd7b8968c3ad59597950e9.zip |
ephy-web-view: Add ephy_web_view_load_failed()
To check whether the load operation in the web view failed.
-rw-r--r-- | doc/reference/epiphany-sections.txt | 1 | ||||
-rw-r--r-- | embed/ephy-web-view.c | 18 | ||||
-rw-r--r-- | embed/ephy-web-view.h | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/doc/reference/epiphany-sections.txt b/doc/reference/epiphany-sections.txt index 2a02e379f..4ea685972 100644 --- a/doc/reference/epiphany-sections.txt +++ b/doc/reference/epiphany-sections.txt @@ -30,6 +30,7 @@ ephy_web_view_get_visibility ephy_web_view_go_up ephy_web_view_has_modified_forms ephy_web_view_is_loading +ephy_web_view_load_failed ephy_web_view_load_request ephy_web_view_load_url ephy_web_view_location_changed diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index c0350a3ca..df290c82a 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -83,6 +83,7 @@ struct _EphyWebViewPrivate { guint visibility : 1; guint loading_homepage : 1; guint is_setting_zoom : 1; + guint load_failed : 1; char *address; char *typed_address; @@ -1943,6 +1944,7 @@ load_status_cb (WebKitWebView *web_view, WebKitWebDataSource *source; WebKitNetworkRequest *request; + priv->load_failed = FALSE; frame = webkit_web_view_get_main_frame (web_view); source = webkit_web_frame_get_provisional_data_source (frame); @@ -2074,6 +2076,7 @@ load_status_cb (WebKitWebView *web_view, break; } case WEBKIT_LOAD_FAILED: + priv->load_failed = TRUE; ephy_web_view_set_link_message (view, NULL); ephy_web_view_set_loading_title (view, NULL, FALSE); @@ -3160,6 +3163,21 @@ ephy_web_view_is_loading (EphyWebView *view) } /** + * ephy_web_view_load_failed: + * @view: an #EphyWebView + * + * Returns whether the web page in @view has failed to load. + * + * Return value: %TRUE if the page failed to load, %FALSE if it's loading + * or load finished successfully + **/ +gboolean +ephy_web_view_load_failed (EphyWebView *view) +{ + return view->priv->load_failed; +} + +/** * ephy_web_view_get_loading_title: * @view: an #EphyWebView * diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h index 28203b274..398285a3e 100644 --- a/embed/ephy-web-view.h +++ b/embed/ephy-web-view.h @@ -137,6 +137,7 @@ void ephy_web_view_load_url (EphyWebView void ephy_web_view_copy_back_history (EphyWebView *source, EphyWebView *dest); gboolean ephy_web_view_is_loading (EphyWebView *view); +gboolean ephy_web_view_load_failed (EphyWebView *view); const char * ephy_web_view_get_loading_title (EphyWebView *view); GdkPixbuf * ephy_web_view_get_icon (EphyWebView *view); EphyWebViewDocumentType ephy_web_view_get_document_type (EphyWebView *view); |