aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ephy-notebook.c13
-rw-r--r--src/ephy-session.c16
2 files changed, 26 insertions, 3 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index cafeb8e18..1b8eeb0b3 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -499,6 +499,14 @@ sync_load_status (EphyWebView *view, GParamSpec *pspec, GtkWidget *proxy)
}
}
+#ifdef HAVE_WEBKIT2
+static void
+load_changed_cb (EphyWebView *view, WebKitLoadEvent load_event, GtkWidget *proxy)
+{
+ sync_load_status (view, NULL, proxy);
+}
+#endif
+
static void
sync_icon (EphyWebView *view,
GParamSpec *pspec,
@@ -632,8 +640,13 @@ build_tab_label (EphyNotebook *nb, EphyEmbed *embed)
G_CALLBACK (sync_icon), icon, 0);
g_signal_connect_object (view, "notify::embed-title",
G_CALLBACK (sync_label), label, 0);
+#ifdef HAVE_WEBKIT2
+ g_signal_connect_object (view, "load-changed",
+ G_CALLBACK (load_changed_cb), hbox, 0);
+#else
g_signal_connect_object (view, "notify::load-status",
G_CALLBACK (sync_load_status), hbox, 0);
+#endif
return hbox;
}
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 82db6f17d..0c67712cb 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -129,7 +129,14 @@ session_delete (EphySession *session,
}
#ifdef HAVE_WEBKIT2
-/* TODO: Loader */
+static void
+load_changed_cb (WebKitWebView *view,
+ WebKitLoadEvent load_event,
+ EphySession *session)
+{
+ if (!ephy_web_view_load_failed (EPHY_WEB_VIEW (view)))
+ ephy_session_save (session, SESSION_STATE);
+}
#else
static void
load_status_notify_cb (EphyWebView *view,
@@ -154,7 +161,8 @@ notebook_page_added_cb (GtkWidget *notebook,
EphySession *session)
{
#ifdef HAVE_WEBKIT2
- /* TODO: Loader */
+ g_signal_connect (ephy_embed_get_web_view (embed), "load-changed",
+ G_CALLBACK (load_changed_cb), session);
#else
g_signal_connect (ephy_embed_get_web_view (embed), "notify::load-status",
G_CALLBACK (load_status_notify_cb), session);
@@ -170,7 +178,9 @@ notebook_page_removed_cb (GtkWidget *notebook,
ephy_session_save (session, SESSION_STATE);
#ifdef HAVE_WEBKIT2
- /* TODO: Loader */
+ g_signal_handlers_disconnect_by_func
+ (ephy_embed_get_web_view (embed), G_CALLBACK (load_changed_cb),
+ session);
#else
g_signal_handlers_disconnect_by_func
(ephy_embed_get_web_view (embed), G_CALLBACK (load_status_notify_cb),