From c08b6233e7306a05a554b319b009e15c14181483 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Sun, 18 Jun 2000 22:07:54 +0000 Subject: [PATCH] Bug #30157 --> add the ability to launch urls using OS default protocol handlers. (NOT PART OF THE BUILD) code review will come when this is done and gets turned on. add nsIExternalProtocolService support to the base class. --- .../exthandler/nsExternalHelperAppService.cpp | 20 ++++++++++++++++++- .../exthandler/nsExternalHelperAppService.h | 5 ++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index b405f361fd12..0c636dc3aef4 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -28,7 +28,7 @@ #include "nsXPIDLString.h" #include "nsMemory.h" #include "nsIStreamListener.h" -#include "nsCExternalHelperApp.h" // contains progids for the helper app service +#include "nsCExternalHandlerService.h" // contains progids for the helper app service NS_IMPL_THREADSAFE_ADDREF(nsExternalHelperAppService) NS_IMPL_THREADSAFE_RELEASE(nsExternalHelperAppService) @@ -37,6 +37,7 @@ NS_INTERFACE_MAP_BEGIN(nsExternalHelperAppService) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIExternalHelperAppService) NS_INTERFACE_MAP_ENTRY(nsIExternalHelperAppService) NS_INTERFACE_MAP_ENTRY(nsPIExternalAppLauncher) + NS_INTERFACE_MAP_ENTRY(nsIExternalProtocolService) NS_INTERFACE_MAP_END_THREADSAFE nsExternalHelperAppService::nsExternalHelperAppService() @@ -78,6 +79,23 @@ nsExternalAppHandler * nsExternalHelperAppService::CreateNewExternalHandler(nsIS return handler; } +////////////////////////////////////////////////////////////////////////////////////////////////////// +// begin external protocol service default implementation... +////////////////////////////////////////////////////////////////////////////////////////////////////// +NS_IMETHODIMP nsExternalHelperAppService::ExternalProtocolHandlerExists(const char * aProtocolScheme, + PRBool * aHandlerExists) +{ + // this method should only be implemented by each OS specific implementation of this service. + *aHandlerExists = PR_FALSE; + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP nsExternalHelperAppService::LoadUrl(nsIURI * aURL) +{ + // this method should only be implemented by each OS specific implementation of this service. + return NS_ERROR_NOT_IMPLEMENTED; +} + ////////////////////////////////////////////////////////////////////////////////////////////////////// // begin external app handler implementation ////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h index 06475ef7c67f..5f5536041dfd 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.h +++ b/uriloader/exthandler/nsExternalHelperAppService.h @@ -24,6 +24,8 @@ #define nsExternalHelperAppService_h__ #include "nsIExternalHelperAppService.h" +#include "nsIExternalProtocolService.h" + #include "nsIStreamListener.h" #include "nsIFile.h" #include "nsIFileStreams.h" @@ -33,12 +35,13 @@ class nsExternalAppHandler; -class nsExternalHelperAppService : public nsIExternalHelperAppService, nsPIExternalAppLauncher +class nsExternalHelperAppService : public nsIExternalHelperAppService, public nsPIExternalAppLauncher, public nsIExternalProtocolService { public: NS_DECL_ISUPPORTS NS_DECL_NSIEXTERNALHELPERAPPSERVICE NS_DECL_NSPIEXTERNALAPPLAUNCHER + NS_DECL_NSIEXTERNALPROTOCOLSERVICE nsExternalHelperAppService(); virtual ~nsExternalHelperAppService();