summaryrefslogtreecommitdiffstats
path: root/extensions/permissions/nsContentBlocker.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /extensions/permissions/nsContentBlocker.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'extensions/permissions/nsContentBlocker.h')
-rw-r--r--extensions/permissions/nsContentBlocker.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/extensions/permissions/nsContentBlocker.h b/extensions/permissions/nsContentBlocker.h
new file mode 100644
index 000000000..880300952
--- /dev/null
+++ b/extensions/permissions/nsContentBlocker.h
@@ -0,0 +1,53 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#ifndef nsContentBlocker_h__
+#define nsContentBlocker_h__
+
+#include "nsIContentPolicy.h"
+#include "nsIObserver.h"
+#include "nsWeakReference.h"
+#include "nsIPermissionManager.h"
+#include "nsIPrefBranch.h"
+#include "mozilla/Attributes.h"
+
+class nsIPrefBranch;
+
+////////////////////////////////////////////////////////////////////////////////
+
+class nsContentBlocker final : public nsIContentPolicy,
+ public nsIObserver,
+ public nsSupportsWeakReference
+{
+public:
+
+ // nsISupports
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSICONTENTPOLICY
+ NS_DECL_NSIOBSERVER
+
+ nsContentBlocker();
+ nsresult Init();
+
+private:
+ ~nsContentBlocker() {}
+
+ void PrefChanged(nsIPrefBranch *, const char *);
+ nsresult TestPermission(nsIURI *aCurrentURI,
+ nsIURI *aFirstURI,
+ int32_t aContentType,
+ bool *aPermission,
+ bool *aFromPrefs);
+
+ nsCOMPtr<nsIPermissionManager> mPermissionManager;
+ nsCOMPtr<nsIPrefBranch> mPrefBranchInternal;
+ static uint8_t mBehaviorPref[];
+};
+
+#define NS_CONTENTBLOCKER_CID \
+{ 0x4ca6b67b, 0x5cc7, 0x4e71, \
+ { 0xa9, 0x8a, 0x97, 0xaf, 0x1c, 0x13, 0x48, 0x62 } }
+
+#define NS_CONTENTBLOCKER_CONTRACTID "@mozilla.org/permissions/contentblocker;1"
+
+#endif /* nsContentBlocker_h__ */