diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /extensions/permissions/nsContentBlocker.h | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | uxp-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz |
Add m-esr52 at 52.6.0
Diffstat (limited to 'extensions/permissions/nsContentBlocker.h')
-rw-r--r-- | extensions/permissions/nsContentBlocker.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/extensions/permissions/nsContentBlocker.h b/extensions/permissions/nsContentBlocker.h new file mode 100644 index 0000000000..8803009520 --- /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__ */ |