Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / xpinstall / src / nsInstallTrigger.h
bloba360c23f0bd1635fb991470a0b0b301f89c3e656
1 #ifndef __NS_INSTALLTRIGGER_H__
2 #define __NS_INSTALLTRIGGER_H__
4 #include "nscore.h"
5 #include "nsString.h"
6 #include "nsIFactory.h"
7 #include "nsISupports.h"
8 #include "nsIScriptObjectOwner.h"
10 #include "prtypes.h"
11 #include "nsHashtable.h"
13 #include "nsIDOMInstallTriggerGlobal.h"
14 #include "nsXPITriggerInfo.h"
16 #include "nsIContentHandler.h"
18 #define NOT_CHROME 0
19 #define CHROME_SKIN 1
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
43 public:
44 nsInstallTrigger();
45 virtual ~nsInstallTrigger();
47 NS_DECL_ISUPPORTS
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);
59 private:
60 PRBool AllowInstall(nsIURI* aLaunchURI);
61 void *mScriptObject;
64 #define NS_INSTALLTRIGGERCOMPONENT_CONTRACTID "@mozilla.org/xpinstall/installtrigger;1"
65 #endif