/src/mozilla-central/dom/payments/ipc/PaymentRequestParent.h
Line | Count | Source (jump to first uncovered line) |
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_PaymentRequestParent_h |
8 | | #define mozilla_dom_PaymentRequestParent_h |
9 | | |
10 | | #include "mozilla/dom/PPaymentRequestParent.h" |
11 | | #include "nsIPaymentAddress.h" |
12 | | #include "nsIPaymentActionResponse.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | class PaymentRequestParent final : public PPaymentRequestParent |
18 | | { |
19 | | NS_INLINE_DECL_REFCOUNTING(PaymentRequestParent) |
20 | | public: |
21 | | explicit PaymentRequestParent(uint64_t aTabId); |
22 | | |
23 | | uint64_t GetTabId(); |
24 | | nsresult RespondPayment(nsIPaymentActionResponse* aResponse); |
25 | | nsresult ChangeShippingAddress(const nsAString& aRequestId, |
26 | | nsIPaymentAddress* aAddress); |
27 | | nsresult ChangeShippingOption(const nsAString& aRequestId, |
28 | | const nsAString& aOption); |
29 | | nsresult ChangePayerDetail(const nsAString& aRequestId, |
30 | | const nsAString& aPayerName, |
31 | | const nsAString& aPayerEmail, |
32 | | const nsAString& aPayerPhone); |
33 | | |
34 | | protected: |
35 | | mozilla::ipc::IPCResult |
36 | | RecvRequestPayment(const IPCPaymentActionRequest& aRequest) override; |
37 | | |
38 | | mozilla::ipc::IPCResult Recv__delete__() override; |
39 | | |
40 | | void ActorDestroy(ActorDestroyReason aWhy) override; |
41 | | private: |
42 | 0 | ~PaymentRequestParent() = default; |
43 | | |
44 | | bool mActorAlive; |
45 | | uint64_t mTabId; |
46 | | nsString mRequestId; |
47 | | }; |
48 | | |
49 | | } // end of namespace dom |
50 | | } // end of namespace mozilla |
51 | | |
52 | | #endif |