tor-browser

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

PaymentRequestChild.h (1895B)


      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_PaymentRequestChild_h
      8 #define mozilla_dom_PaymentRequestChild_h
      9 
     10 #include "mozilla/dom/PPaymentRequestChild.h"
     11 
     12 namespace mozilla::dom {
     13 
     14 class PaymentRequest;
     15 
     16 class PaymentRequestChild final : public PPaymentRequestChild {
     17  friend class PPaymentRequestChild;
     18 
     19 public:
     20  explicit PaymentRequestChild(PaymentRequest* aRequest);
     21 
     22  void MaybeDelete(bool aCanBeInManager);
     23 
     24  nsresult RequestPayment(const IPCPaymentActionRequest& aAction);
     25 
     26 protected:
     27  mozilla::ipc::IPCResult RecvRespondPayment(
     28      const IPCPaymentActionResponse& aResponse);
     29 
     30  mozilla::ipc::IPCResult RecvChangeShippingAddress(
     31      const nsString& aRequestId, const IPCPaymentAddress& aAddress);
     32 
     33  mozilla::ipc::IPCResult RecvChangeShippingOption(const nsString& aRequestId,
     34                                                   const nsString& aOption);
     35 
     36  mozilla::ipc::IPCResult RecvChangePayerDetail(const nsString& aRequestId,
     37                                                const nsString& aPayerName,
     38                                                const nsString& aPayerEmail,
     39                                                const nsString& aPayerPhone);
     40 
     41  mozilla::ipc::IPCResult RecvChangePaymentMethod(
     42      const nsString& aRequestId, const nsString& aMethodName,
     43      const IPCMethodChangeDetails& aMethodDetails);
     44 
     45  void ActorDestroy(ActorDestroyReason aWhy) override;
     46 
     47 private:
     48  ~PaymentRequestChild() = default;
     49 
     50  void DetachFromRequest(bool aCanBeInManager);
     51 
     52  PaymentRequest* MOZ_NON_OWNING_REF mRequest;
     53 };
     54 
     55 }  // namespace mozilla::dom
     56 
     57 #endif