diff options
author | Alejandro G. Castro <alex@igalia.com> | 2010-04-30 01:25:29 +0800 |
---|---|---|
committer | Alejandro G. Castro <alex@igalia.com> | 2010-05-03 18:50:41 +0800 |
commit | d60afa35bed002f98996fbdeb6a34ad01cc5b2cf (patch) | |
tree | 8a157809046533a3a9de04cbe19b8e5d4a52c087 /embed/ephy-embed.c | |
parent | 4e914078cd832490b1d31804836f3ac2274fdaf0 (diff) | |
download | gsoc2013-epiphany-d60afa35bed002f98996fbdeb6a34ad01cc5b2cf.tar gsoc2013-epiphany-d60afa35bed002f98996fbdeb6a34ad01cc5b2cf.tar.gz gsoc2013-epiphany-d60afa35bed002f98996fbdeb6a34ad01cc5b2cf.tar.bz2 gsoc2013-epiphany-d60afa35bed002f98996fbdeb6a34ad01cc5b2cf.tar.lz gsoc2013-epiphany-d60afa35bed002f98996fbdeb6a34ad01cc5b2cf.tar.xz gsoc2013-epiphany-d60afa35bed002f98996fbdeb6a34ad01cc5b2cf.tar.zst gsoc2013-epiphany-d60afa35bed002f98996fbdeb6a34ad01cc5b2cf.zip |
Refactored the load status callback of ephy-web-view.c
This patch uses the ephy-embed.c callback code and refactors it in
just one method in the ephy-web-view that handles all the status
changes for this object.
Bug #593743
Diffstat (limited to 'embed/ephy-embed.c')
-rw-r--r-- | embed/ephy-embed.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 878cd36f1..87db4ffe2 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -62,7 +62,6 @@ struct EphyEmbedPrivate WebKitWebView *web_view; EphyHistory *history; GtkWidget *inspector_window; - char *loading_uri; guint is_setting_zoom : 1; GSList *destroy_on_transition_list; }; @@ -196,87 +195,20 @@ load_status_changed_cb (WebKitWebView *view, GParamSpec *spec, EphyEmbed *embed) { - EphyEmbedPrivate *priv = embed->priv; WebKitLoadStatus status = webkit_web_view_get_load_status (view); if (status == WEBKIT_LOAD_COMMITTED) { const gchar* uri; - EphyWebViewSecurityLevel security_level; uri = webkit_web_view_get_uri (view); ephy_embed_destroy_top_widgets (embed); - if (g_strcmp0 (uri, priv->loading_uri) != 0) { - g_free (priv->loading_uri); - priv->loading_uri = g_strdup (uri); - } - - ephy_web_view_location_changed (EPHY_WEB_VIEW (view), - uri); restore_zoom_level (embed, uri); ephy_history_add_page (embed->priv->history, uri, FALSE, FALSE); - -#ifdef GTLS_SYSTEM_CA_FILE - if (uri && g_str_has_prefix (uri, "https")) { - WebKitWebFrame *frame; - WebKitWebDataSource *source; - WebKitNetworkRequest *request; - SoupMessage *message; - - frame = webkit_web_view_get_main_frame (view); - source = webkit_web_frame_get_data_source (frame); - request = webkit_web_data_source_get_request (source); - message = webkit_network_request_get_message (request); - - if (message && - (soup_message_get_flags (message) & SOUP_MESSAGE_CERTIFICATE_TRUSTED)) - security_level = EPHY_WEB_VIEW_STATE_IS_SECURE_HIGH; - else - security_level = EPHY_WEB_VIEW_STATE_IS_BROKEN; - } else - security_level = EPHY_WEB_VIEW_STATE_IS_UNKNOWN; -#else - security_level = EPHY_WEB_VIEW_STATE_IS_UNKNOWN; -#endif - - ephy_web_view_set_security_level (EPHY_WEB_VIEW (view), security_level); - } else if (status == WEBKIT_LOAD_PROVISIONAL || status == WEBKIT_LOAD_FINISHED) { - char *loading_uri = NULL; - - 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 = g_strdup (webkit_network_request_get_uri (request)); - - /* We also store the URI we are currently loading here, because - * we will want to use it in WEBKIT_LOAD_FINISHED, because if a - * load fails we may never get to committed */ - priv->loading_uri = g_strdup (loading_uri); - - g_signal_emit_by_name (EPHY_WEB_VIEW (view), "new-document-now", loading_uri); - } else if (status == WEBKIT_LOAD_FINISHED) { - loading_uri = priv->loading_uri; - - /* Will be freed below */ - priv->loading_uri = NULL; - - } - - ephy_web_view_update_from_net_state (EPHY_WEB_VIEW (view), - loading_uri, - status); - - g_free (loading_uri); - } } @@ -347,8 +279,6 @@ ephy_embed_finalize (GObject *object) EphyEmbed *embed = EPHY_EMBED (object); GSList *list; - g_free (embed->priv->loading_uri); - list = embed->priv->destroy_on_transition_list; for (; list; list = list->next) { GtkWidget *widget = GTK_WIDGET (list->data); |