[epiphany] ephy-embed: reimplent EphyEmbedSingle 'handle-content' signal



commit 82a5da33bdcd8673cbf48de1159ae4f65fec8f64
Author: Xan Lopez <xan gnome org>
Date:   Wed Dec 2 21:39:47 2009 +0200

    ephy-embed: reimplent EphyEmbedSingle 'handle-content' signal
    
    This is used by external download managers like gwget.

 embed/ephy-embed.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index b49ab0f..16f9ded 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -393,7 +393,19 @@ mime_type_policy_decision_requested_cb (WebKitWebView *web_view,
      process */
   /* FIXME: need to use ephy_file_check_mime if auto-downloading */
   if (!webkit_web_view_can_show_mime_type (web_view, mime_type)) {
-    webkit_web_policy_decision_download (decision);
+    GObject *single;
+    const char *uri;
+    gboolean handled = FALSE;
+
+    single = ephy_embed_shell_get_embed_single (embed_shell);
+    uri = webkit_network_request_get_uri (request);
+    g_signal_emit_by_name (single, "handle-content", mime_type, uri, &handled);
+
+    if (handled)
+      webkit_web_policy_decision_ignore (decision);
+    else
+      webkit_web_policy_decision_download (decision);
+
     return TRUE;
   }
 



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