2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2003-03-22 04:24:51 +03:00
|
|
|
|
|
|
|
#ifndef nsCookiePermission_h__
|
|
|
|
#define nsCookiePermission_h__
|
|
|
|
|
|
|
|
#include "nsICookiePermission.h"
|
2003-08-16 01:04:54 +04:00
|
|
|
#include "nsIPermissionManager.h"
|
2003-10-11 01:23:44 +04:00
|
|
|
#include "nsIObserver.h"
|
2003-08-16 01:04:54 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2012-09-15 00:57:56 +04:00
|
|
|
#include "mozIThirdPartyUtil.h"
|
2003-03-22 04:24:51 +03:00
|
|
|
|
2003-10-11 01:23:44 +04:00
|
|
|
class nsIPrefBranch;
|
|
|
|
|
2003-03-22 04:24:51 +03:00
|
|
|
class nsCookiePermission : public nsICookiePermission
|
2003-10-11 01:23:44 +04:00
|
|
|
, public nsIObserver
|
2003-03-22 04:24:51 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSICOOKIEPERMISSION
|
2003-10-11 01:23:44 +04:00
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2012-09-15 00:57:56 +04:00
|
|
|
nsCookiePermission()
|
2012-09-28 23:55:23 +04:00
|
|
|
: mCookiesLifetimeSec(INT64_MAX)
|
2004-05-05 06:06:38 +04:00
|
|
|
, mCookiesLifetimePolicy(0) // ACCEPT_NORMALLY
|
2011-10-17 18:59:28 +04:00
|
|
|
, mCookiesAlwaysAcceptSession(false)
|
2003-10-11 01:23:44 +04:00
|
|
|
{}
|
|
|
|
virtual ~nsCookiePermission() {}
|
|
|
|
|
2010-03-26 02:02:28 +03:00
|
|
|
bool Init();
|
|
|
|
void PrefChanged(nsIPrefBranch *, const char *);
|
2003-08-16 01:04:54 +04:00
|
|
|
|
|
|
|
private:
|
2013-04-03 05:06:20 +04:00
|
|
|
bool EnsureInitialized() { return (mPermMgr != nullptr && mThirdPartyUtil != nullptr) || Init(); };
|
2009-01-21 10:46:28 +03:00
|
|
|
|
2003-08-16 01:04:54 +04:00
|
|
|
nsCOMPtr<nsIPermissionManager> mPermMgr;
|
2012-09-15 00:57:56 +04:00
|
|
|
nsCOMPtr<mozIThirdPartyUtil> mThirdPartyUtil;
|
2003-10-11 01:23:44 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int64_t mCookiesLifetimeSec; // lifetime limit specified in seconds
|
|
|
|
uint8_t mCookiesLifetimePolicy; // pref for how long cookies are stored
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mCookiesAlwaysAcceptSession; // don't prompt for session cookies
|
2003-03-22 04:24:51 +03:00
|
|
|
};
|
|
|
|
|
2007-06-22 15:12:13 +04:00
|
|
|
// {EF565D0A-AB9A-4A13-9160-0644CDFD859A}
|
2003-03-22 04:24:51 +03:00
|
|
|
#define NS_COOKIEPERMISSION_CID \
|
|
|
|
{0xEF565D0A, 0xAB9A, 0x4A13, {0x91, 0x60, 0x06, 0x44, 0xcd, 0xfd, 0x85, 0x9a }}
|
|
|
|
|
|
|
|
#endif
|