[epiphany/in-tab-overview: 21/23] ephy-window: handle open-link for the overview in the active tab



commit 6c0a0e1b82d0cb5f8240240ce9bfdd7dc22ef90f
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Aug 20 19:00:45 2012 +0300

    ephy-window: handle open-link for the overview in the active tab

 src/ephy-window.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 0177e51..b2ced96 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2087,6 +2087,14 @@ ephy_window_visibility_cb (EphyEmbed *embed, GParamSpec *pspec, EphyWindow *wind
 }
 
 static void
+overview_open_link_cb (EphyOverview *overview,
+		       const char *url,
+		       EphyWindow *window)
+{
+	ephy_link_open (EPHY_LINK (window), url, NULL, 0);
+}
+
+static void
 ephy_window_set_is_popup (EphyWindow *window,
 			  gboolean is_popup)
 {
@@ -2527,6 +2535,7 @@ ephy_window_connect_active_embed (EphyWindow *window)
 	EphyEmbed *embed;
 	WebKitWebView *web_view;
 	EphyWebView *view;
+	EphyOverview *overview;
 
 	g_return_if_fail (window->priv->active_embed != NULL);
 
@@ -2623,6 +2632,11 @@ ephy_window_connect_active_embed (EphyWindow *window)
 				 G_CALLBACK (ephy_window_visibility_cb),
 				 window, 0);
 
+	overview = ephy_embed_get_overview (embed);
+	g_signal_connect_object (overview, "open-link",
+				 G_CALLBACK (overview_open_link_cb),
+				 window, 0);
+
 	g_object_notify (G_OBJECT (window), "active-child");
 }
 
@@ -2632,6 +2646,7 @@ ephy_window_disconnect_active_embed (EphyWindow *window)
 	EphyEmbed *embed;
 	WebKitWebView *web_view;
 	EphyWebView *view;
+	EphyOverview *overview;
 	guint sid;
 
 	g_return_if_fail (window->priv->active_embed != NULL);
@@ -2708,6 +2723,11 @@ ephy_window_disconnect_active_embed (EphyWindow *window)
 					      G_CALLBACK (ephy_window_visibility_cb),
 					      window);
 
+	overview = ephy_embed_get_overview (embed);
+	g_signal_handlers_disconnect_by_func (overview,
+					      G_CALLBACK (overview_open_link_cb),
+					      window);
+
 	g_signal_handlers_disconnect_by_func
 		(view, G_CALLBACK (ephy_window_dom_mouse_click_cb), window);
 }



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