From e464015f47f6d575f5db02d851d7ea4b88278e34 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 20 Nov 2003 19:12:19 +0000 Subject: Implement an handle_content signal to allow to write plugins to support 2003-11-20 Marco Pesenti Gritti * embed/ephy-embed-single.c: (ephy_embed_single_class_init): * embed/ephy-embed-single.h: * embed/mozilla/ContentHandler.cpp: * embed/mozilla/EphyHeaderSniffer.cpp: * embed/mozilla/EphyHeaderSniffer.h: * lib/ephy-marshal.list: Implement an handle_content signal to allow to write plugins to support external download managers. --- embed/mozilla/ContentHandler.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'embed/mozilla/ContentHandler.cpp') diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp index 8f0267d33..dc4382943 100644 --- a/embed/mozilla/ContentHandler.cpp +++ b/embed/mozilla/ContentHandler.cpp @@ -73,17 +73,26 @@ NS_IMETHODIMP GContentHandler::Show(nsIHelperAppLauncher *aLauncher, nsISupports *aContext) #endif { - /* aForced reflects if the content being sent is normally viewable - * in mozilla or not. That fact doesn't affect us, so ignore it - */ - nsresult rv; + EphyEmbedSingle *single; + gboolean handled = FALSE; mLauncher = aLauncher; rv = Init (); if (NS_FAILED (rv)) return rv; - - MIMEAskAction (); + + single = ephy_embed_shell_get_embed_single (embed_shell); + g_signal_emit_by_name (single, "handle_content", mMimeType, + mUrl.get(), &handled); + + if (!handled) + { + MIMEAskAction (); + } + else + { + mLauncher->Cancel (); + } return NS_OK; } -- cgit v1.2.3