From ab00d9bb79646d2edfac6a6abf0221b612575774 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Mon, 17 Jan 2000 22:21:25 +0000 Subject: [PATCH] Bug #24174 --> when clicking on a mailto ur, we were bringing up the compose window and the unknown content handler dialog. we should only be bringing up the compose window =) r=sspitzer --- uriloader/base/nsIURILoader.idl | 3 ++- uriloader/base/nsURILoader.cpp | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/uriloader/base/nsIURILoader.idl b/uriloader/base/nsIURILoader.idl index 476a7f4409b5..9c4a02f0abf7 100644 --- a/uriloader/base/nsIURILoader.idl +++ b/uriloader/base/nsIURILoader.idl @@ -121,7 +121,8 @@ interface nsIURILoader : nsISupports in nsISupports aCtxt, in nsIURIContentListener aContentListener, out string aDesiredContentType, - out nsIURIContentListener aTargetListener); + out nsIURIContentListener aTargetListener, + out boolean abortDispatch); /* this command should become obsolete once we get rid of the old layout "verb" command string and replace it with the enumerated type nsURILoaderCommand */ diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index c08e280c9492..cbff5661e58f 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -223,11 +223,18 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIChannel * aChannel, nsISupports // First step: See if any nsIURIContentListener prefers to handle this // content type. // + PRBool abortDispatch = PR_FALSE; rv = pURILoader->DispatchContent(contentType, mCommand, m_windowTarget, aChannel, aCtxt, m_contentListener, getter_Copies(desiredContentType), - getter_AddRefs(contentListener)); + getter_AddRefs(contentListener), + &abortDispatch); + + // if the uri loader says to abort the dispatch then someone + // else must have stepped in and taken over for us...so stop.. + + if (abortDispatch) return NS_OK; // // Second step: If no listener prefers this type, see if any stream // decoders exist to transform this content type into @@ -436,7 +443,8 @@ nsresult nsURILoader::DispatchContent(const char * aContentType, nsISupports * aCtxt, nsIURIContentListener * aContentListener, char ** aContentTypeToUse, - nsIURIContentListener ** aContentListenerToUse) + nsIURIContentListener ** aContentListenerToUse, + PRBool * aAbortProcess) { // okay, now we've discovered the content type. We need to do the following: // (1) Give our uri content listener first crack at handling this content type. @@ -488,7 +496,10 @@ nsresult nsURILoader::DispatchContent(const char * aContentType, nsCOMPtr aContentHandler; rv = nsComponentManager::CreateInstance(handlerProgID, nsnull, NS_GET_IID(nsIContentHandler), getter_AddRefs(aContentHandler)); if (NS_SUCCEEDED(rv)) // we did indeed have a content handler for this type!! yippee... + { rv = aContentHandler->HandleContent(aContentType, "view", aWindowTarget, aChannel); + *aAbortProcess = PR_TRUE; + } return rv; }