[epiphany/gnome-2-28] Pass mailto: URI to gtk_show_uri()



commit e0ede04cf118f740b76adce7bfea8c1e8b5c1e81
Author: Frédéric Péters <fpeters 0d be>
Date:   Fri Oct 9 20:07:20 2009 +0200

    Pass mailto: URI to gtk_show_uri()
    
    (Part of) Bug #584537
    
    Signed-off-by: Xan Lopez <xan gnome org>

 embed/ephy-embed-utils.c |    1 +
 src/ephy-window.c        |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index d937d2e..eb7c434 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -92,6 +92,7 @@ ephy_embed_utils_address_has_web_scheme (const char *address)
 			  g_str_has_prefix (address, "data:") ||
 			  g_str_has_prefix (address, "about:") ||
 			  g_str_has_prefix (address, "javascript:") ||
+			  g_str_has_prefix (address, "mailto:";) ||
 			  g_str_has_prefix (address, "gopher:"));
 
 	return has_web_scheme;
diff --git a/src/ephy-window.c b/src/ephy-window.c
index d7c9b23..ded2cec 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2555,10 +2555,18 @@ policy_decision_required_cb (WebKitWebView *web_view,
 	WebKitWebNavigationReason reason;
 	gint button;
 	gint state;
+	const char *uri;
 
 	reason = webkit_web_navigation_action_get_reason (action);
 	button = webkit_web_navigation_action_get_button (action);
 	state = webkit_web_navigation_action_get_modifier_state (action);
+	uri = webkit_network_request_get_uri (request);
+
+	if (g_str_has_prefix (uri, "mailto:";)) {
+		webkit_web_policy_decision_ignore (decision);
+		gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL);
+		return TRUE;
+	}
 
 	/* Open in new tab for middle click or ctrl+click */
 	if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED &&



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