зеркало из https://github.com/mozilla/pjs.git
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.
This commit is contained in:
Родитель
44c5271f18
Коммит
8ce9199393
|
@ -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
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче