[epiphany] Open requested URI in new tab when a crashed session exists



commit 05df86164b7aa8286cf8353355378145cf64b656
Author: Gustavo Noronha Silva <gns gnome org>
Date:   Sat Mar 12 00:08:51 2011 -0300

    Open requested URI in new tab when a crashed session exists
    
    When you ask Epiphany to load a new URI but a crashed session exists,
    the session was being completely discarded in favour of the new
    URI. This change causes the URI to be loaded in a new tab in the
    background while still presenting the user with the option to recover
    the session.
    
    Bug #625116

 src/ephy-session.c |   32 +++++++++++++++++++++++---------
 1 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 183ef2d..995849f 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -544,7 +544,7 @@ session_command_autoresume (EphySession *session,
 
 	ephy_session_queue_command (session,
 				    EPHY_SESSION_CMD_MAYBE_OPEN_WINDOW_RESTORE,
-				    NULL, NULL, user_time, FALSE);
+				    NULL, NULL, user_time, TRUE);
 }
 
 static void
@@ -612,14 +612,29 @@ session_command_open_uris (EphySession *session,
 
 		/* For the first URI, if we have a valid recovery
 		 * window, reuse the already existing embed instead of
-		 * creating a new one */
+		 * creating a new one, except if we still want to
+		 * present the option to resume a crashed session, in
+		 * that case use a new tab in the same window */
 		if (i == 0 && priv->resume_window != NULL)
 		{
-			EphyWebView *web_view;
-			
-			embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (priv->resume_window));
-			web_view = ephy_embed_get_web_view (embed);
-			ephy_web_view_load_url (web_view, url);
+			if (priv->resume_infobar != NULL)
+			{
+				embed = ephy_shell_new_tab_full (shell, priv->resume_window,
+								 NULL /* parent tab */,
+								 request,
+								 EPHY_NEW_TAB_IN_EXISTING_WINDOW | page_flags,
+								 EPHY_WEB_VIEW_CHROME_ALL,
+								 FALSE /* is popup? */,
+								 user_time);
+			}
+			else
+			{
+				EphyWebView *web_view;
+
+				embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (priv->resume_window));
+				web_view = ephy_embed_get_web_view (embed);
+				ephy_web_view_load_url (web_view, url);
+			}
 		}
 		else
 		{
@@ -795,8 +810,7 @@ session_command_dispatch (EphySession *session)
 	}
 
 	/* Look if there's anything else to dispatch */
-	if (g_queue_is_empty (priv->queue) ||
-	    priv->resume_window != NULL)
+	if (g_queue_is_empty (priv->queue))
 	{
 		priv->queue_idle_id = 0;
 		run_again = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]