[epiphany] ephy-window: pass non-web schemas to gtk_show_uri
- From: Diego Escalante Urrelo <diegoe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-window: pass non-web schemas to gtk_show_uri
- Date: Mon, 23 Jan 2012 17:11:48 +0000 (UTC)
commit 607017e7381f71968f64d7a464b2d94826db0dad
Author: Diego Escalante Urrelo <descalante igalia com>
Date: Wed Jan 20 17:00:04 2010 -0500
ephy-window: pass non-web schemas to gtk_show_uri
Handle every non-web scheme in policy_decision_required_cb with
gtk_show_uri. This enables xmpp:, apt: and similar links to work.
https://bugzilla.gnome.org/show_bug.cgi?id=551857
src/ephy-window.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 5a6dbd2..1b5737a 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2290,9 +2290,22 @@ policy_decision_required_cb (WebKitWebView *web_view,
state = webkit_web_navigation_action_get_modifier_state (action);
uri = webkit_network_request_get_uri (request);
- if (g_str_has_prefix (uri, "mailto:")) {
+ if (!ephy_embed_utils_address_has_web_scheme (uri))
+ {
+ GError *error = NULL;
+ GdkScreen *screen;
+
webkit_web_policy_decision_ignore (decision);
- gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL);
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (web_view));
+ gtk_show_uri (screen, uri, GDK_CURRENT_TIME, &error);
+
+ if (error)
+ {
+ LOG ("failed to handle non web scheme: %s", error->message);
+ g_error_free (error);
+ }
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]