summaryrefslogtreecommitdiffstats
path: root/toolkit/components/cookiebanners/nsClickRule.h
blob: 5dca36b78d6a8b0f865cd1bae48cafc94bff1fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* 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 mozilla_nsclickrule_h__
#define mozilla_nsclickrule_h__

#include "nsIClickRule.h"
#include "nsICookieBannerRule.h"
#include "nsString.h"

namespace mozilla {

class nsClickRule final : public nsIClickRule {
  NS_DECL_ISUPPORTS
  NS_DECL_NSICLICKRULE

  explicit nsClickRule(nsICookieBannerRule* aCookieBannerRule,
                       const nsACString& aPresence,
                       const bool aSkipPresenceVisibilityCheck,
                       const nsIClickRule::RunContext aRunContext,
                       const nsACString& aHide, const nsACString& aOptOut,
                       const nsACString& aOptIn)
      : mCookieBannerRule(aCookieBannerRule),
        mPresence(aPresence),
        mSkipPresenceVisibilityCheck(aSkipPresenceVisibilityCheck),
        mRunContext(aRunContext),
        mHide(aHide),
        mOptOut(aOptOut),
        mOptIn(aOptIn) {}

 private:
  ~nsClickRule() = default;

  // The reference to the cookie banner rule that holds this clicking rule.
  nsICookieBannerRule* mCookieBannerRule;
  nsCString mPresence;
  bool mSkipPresenceVisibilityCheck;
  nsIClickRule::RunContext mRunContext;
  nsCString mHide;
  nsCString mOptOut;
  nsCString mOptIn;
};

}  // namespace mozilla

#endif  // mozilla_nsclickrule_h__