1 #ifndef __NS_INSTALLTRIGGER_H__
2 #define __NS_INSTALLTRIGGER_H__
6 #include "nsIFactory.h"
7 #include "nsISupports.h"
8 #include "nsIScriptObjectOwner.h"
11 #include "nsHashtable.h"
13 #include "nsIDOMInstallTriggerGlobal.h"
14 #include "nsXPITriggerInfo.h"
16 #include "nsIContentHandler.h"
20 #define CHROME_LOCALE 2
21 #define CHROME_SAFEMAX CHROME_SKIN
22 #define CHROME_CONTENT 4
23 #define CHROME_ALL (CHROME_SKIN | CHROME_LOCALE | CHROME_CONTENT)
24 #define CHROME_PROFILE 8
25 #define CHROME_DELAYED 0x10
26 #define CHROME_SELECT 0x20
28 #define XPI_PERMISSION "install"
30 #define XPI_WHITELIST PR_TRUE
31 #define XPI_GLOBAL PR_FALSE
33 #define XPINSTALL_ENABLE_PREF "xpinstall.enabled"
34 #define XPINSTALL_WHITELIST_ADD "xpinstall.whitelist.add"
35 #define XPINSTALL_WHITELIST_ADD_103 "xpinstall.whitelist.add.103"
36 #define XPINSTALL_WHITELIST_REQUIRED "xpinstall.whitelist.required"
37 #define XPINSTALL_BLACKLIST_ADD "xpinstall.blacklist.add"
39 class nsInstallTrigger
: public nsIScriptObjectOwner
,
40 public nsIDOMInstallTriggerGlobal
,
41 public nsIContentHandler
45 virtual ~nsInstallTrigger();
48 NS_DECL_NSICONTENTHANDLER
50 NS_IMETHOD
GetScriptObject(nsIScriptContext
*aContext
, void** aScriptObject
);
51 NS_IMETHOD
SetScriptObject(void* aScriptObject
);
53 NS_IMETHOD
GetOriginatingURI(nsIScriptGlobalObject
* aGlobalObject
, nsIURI
* *aUri
);
54 NS_IMETHOD
UpdateEnabled(nsIScriptGlobalObject
* aGlobalObject
, PRBool aUseWhitelist
, PRBool
* aReturn
);
55 NS_IMETHOD
UpdateEnabled(nsIURI
* aURI
, PRBool aUseWhitelist
, PRBool
* aReturn
);
56 NS_IMETHOD
StartInstall(nsIXPIInstallInfo
* aInstallInfo
, PRBool
* aReturn
);
60 PRBool
AllowInstall(nsIURI
* aLaunchURI
);
64 #define NS_INSTALLTRIGGERCOMPONENT_CONTRACTID "@mozilla.org/xpinstall/installtrigger;1"