michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef nsContentBlocker_h__ michael@0: #define nsContentBlocker_h__ michael@0: michael@0: #include "nsIContentPolicy.h" michael@0: #include "nsIObserver.h" michael@0: #include "nsWeakReference.h" michael@0: #include "nsIPermissionManager.h" michael@0: #include "nsIPrefBranch.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsIPrefBranch; michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: class nsContentBlocker MOZ_FINAL : public nsIContentPolicy, michael@0: public nsIObserver, michael@0: public nsSupportsWeakReference michael@0: { michael@0: public: michael@0: michael@0: // nsISupports michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSICONTENTPOLICY michael@0: NS_DECL_NSIOBSERVER michael@0: michael@0: nsContentBlocker(); michael@0: nsresult Init(); michael@0: michael@0: private: michael@0: ~nsContentBlocker() {} michael@0: michael@0: void PrefChanged(nsIPrefBranch *, const char *); michael@0: nsresult TestPermission(nsIURI *aCurrentURI, michael@0: nsIURI *aFirstURI, michael@0: int32_t aContentType, michael@0: bool *aPermission, michael@0: bool *aFromPrefs); michael@0: michael@0: nsCOMPtr mPermissionManager; michael@0: nsCOMPtr mPrefBranchInternal; michael@0: static uint8_t mBehaviorPref[]; michael@0: }; michael@0: michael@0: #define NS_CONTENTBLOCKER_CID \ michael@0: { 0x4ca6b67b, 0x5cc7, 0x4e71, \ michael@0: { 0xa9, 0x8a, 0x97, 0xaf, 0x1c, 0x13, 0x48, 0x62 } } michael@0: michael@0: #define NS_CONTENTBLOCKER_CONTRACTID "@mozilla.org/permissions/contentblocker;1" michael@0: michael@0: #endif /* nsContentBlocker_h__ */