tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PaymentMethodChangeEvent.h (2070B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_dom_PaymentMethodChangeEvent_h
      8 #define mozilla_dom_PaymentMethodChangeEvent_h
      9 
     10 #include "mozilla/dom/PaymentMethodChangeEventBinding.h"
     11 #include "mozilla/dom/PaymentRequest.h"
     12 #include "mozilla/dom/PaymentRequestUpdateEvent.h"
     13 
     14 namespace mozilla::dom {
     15 class PaymentRequestUpdateEvent;
     16 struct PaymentMethodChangeEventInit;
     17 class PaymentMethodChangeEvent final : public PaymentRequestUpdateEvent {
     18 public:
     19  NS_DECL_ISUPPORTS_INHERITED
     20  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
     21      PaymentMethodChangeEvent, PaymentRequestUpdateEvent)
     22 
     23  explicit PaymentMethodChangeEvent(EventTarget* aOwner);
     24 
     25  virtual JSObject* WrapObjectInternal(
     26      JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
     27 
     28  static already_AddRefed<PaymentMethodChangeEvent> Constructor(
     29      EventTarget* aOwner, const nsAString& aType,
     30      const PaymentRequestUpdateEventInit& aEventInitDict,
     31      const nsAString& aMethodName, const ChangeDetails& aMethodDetails);
     32 
     33  // Called by WebIDL constructor
     34  static already_AddRefed<PaymentMethodChangeEvent> Constructor(
     35      const GlobalObject& aGlobal, const nsAString& aType,
     36      const PaymentMethodChangeEventInit& aEventInitDict);
     37 
     38  void GetMethodName(nsAString& aMethodName);
     39  void SetMethodName(const nsAString& aMethodName);
     40 
     41  void GetMethodDetails(JSContext* cx, JS::MutableHandle<JSObject*> retval);
     42  void SetMethodDetails(const ChangeDetails& aMethodDetails);
     43 
     44 protected:
     45  void init(const PaymentMethodChangeEventInit& aEventInitDict);
     46  ~PaymentMethodChangeEvent();
     47 
     48 private:
     49  JS::Heap<JSObject*> mMethodDetails;
     50  ChangeDetails mInternalDetails;
     51  nsString mMethodName;
     52 };
     53 
     54 }  // namespace mozilla::dom
     55 
     56 #endif  // mozilla_dom_PaymentMethodChangeEvent_h