From ce7ab1e34804d9f7529bed13267f4619c37e32d9 Mon Sep 17 00:00:00 2001 From: Gustavo Noronha Silva Date: Sat, 9 Feb 2013 16:43:02 -0200 Subject: Only load pages when their tab is switched to upon session restore Firefox has led the way implementing this behaviour to improve the experience of restoring a session with lots of tabs. By delaying the loading of pages to when the user shows interest in them, the time it takes for the browser to become usable is diminished, and less pages are loaded in parallel, which improves load time for the first pages the user sees. It also has the advante of displaying less HTTP Basic Auth dialogs, when the user has many tabs pointed to the same server. https://bugzilla.gnome.org/show_bug.cgi?id=675302 --- embed/ephy-embed-shell.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'embed/ephy-embed-shell.c') diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index ea45a1433..b4366b2f4 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -62,6 +62,7 @@ enum DOWNLOAD_ADDED, DOWNLOAD_REMOVED, PREPARE_CLOSE, + RESTORED_WINDOW, LAST_SIGNAL }; @@ -263,6 +264,12 @@ ephy_embed_shell_prepare_close (EphyEmbedShell *shell) g_signal_emit (shell, signals[PREPARE_CLOSE], 0); } +void +ephy_embed_shell_restored_window (EphyEmbedShell *shell) +{ + g_signal_emit (shell, signals[RESTORED_WINDOW], 0); +} + static void ephy_embed_shell_set_property (GObject *object, guint prop_id, @@ -385,6 +392,23 @@ ephy_embed_shell_class_init (EphyEmbedShellClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); +/** + * EphyEmbedShell::finished-restoring-window: + * @shell: the #EphyEmbedShell + * + * The ::finished-restoring-window signal is emitted when the + * session finishes restoring a window. + **/ + signals[RESTORED_WINDOW] = + g_signal_new ("window-restored", + EPHY_TYPE_EMBED_SHELL, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EphyEmbedShellClass, restored_window), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + g_type_class_add_private (object_class, sizeof (EphyEmbedShellPrivate)); } -- cgit v1.2.3