2017-10-27 01:08:41 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2017-05-25 20:50:32 +03: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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_PaymentRequestChild_h
|
|
|
|
#define mozilla_dom_PaymentRequestChild_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/PPaymentRequestChild.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-05-31 23:30:29 +03:00
|
|
|
class PaymentRequest;
|
|
|
|
|
2017-05-25 20:50:32 +03:00
|
|
|
class PaymentRequestChild final : public PPaymentRequestChild {
|
2019-02-06 18:57:37 +03:00
|
|
|
friend class PPaymentRequestChild;
|
|
|
|
|
2017-05-25 20:50:32 +03:00
|
|
|
public:
|
2018-05-31 23:30:29 +03:00
|
|
|
explicit PaymentRequestChild(PaymentRequest* aRequest);
|
2017-05-25 20:50:32 +03:00
|
|
|
|
2018-06-20 01:55:32 +03:00
|
|
|
void MaybeDelete(bool aCanBeInManager);
|
2017-06-23 12:15:51 +03:00
|
|
|
|
|
|
|
nsresult RequestPayment(const IPCPaymentActionRequest& aAction);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
mozilla::ipc::IPCResult RecvRespondPayment(
|
2017-06-14 10:59:00 +03:00
|
|
|
const IPCPaymentActionResponse& aResponse) override;
|
|
|
|
|
2017-06-23 12:15:51 +03:00
|
|
|
mozilla::ipc::IPCResult RecvChangeShippingAddress(
|
|
|
|
const nsString& aRequestId, const IPCPaymentAddress& aAddress) override;
|
2017-05-25 20:50:32 +03:00
|
|
|
|
2017-06-23 12:15:51 +03:00
|
|
|
mozilla::ipc::IPCResult RecvChangeShippingOption(
|
|
|
|
const nsString& aRequestId, const nsString& aOption) override;
|
|
|
|
|
2018-09-19 14:23:33 +03:00
|
|
|
mozilla::ipc::IPCResult RecvChangePayerDetail(
|
|
|
|
const nsString& aRequestId, const nsString& aPayerName,
|
|
|
|
const nsString& aPayerEmail, const nsString& aPayerPhone) override;
|
|
|
|
|
2018-11-27 16:05:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvChangePaymentMethod(
|
|
|
|
const nsString& aRequestId, const nsString& aMethodName,
|
|
|
|
const IPCMethodChangeDetails& aMethodDetails) override;
|
|
|
|
|
2017-06-23 12:15:51 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2017-05-25 20:50:32 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
~PaymentRequestChild() = default;
|
|
|
|
|
2018-06-20 01:55:32 +03:00
|
|
|
void DetachFromRequest(bool aCanBeInManager);
|
2018-06-20 01:58:37 +03:00
|
|
|
|
2018-05-31 23:30:29 +03:00
|
|
|
PaymentRequest* MOZ_NON_OWNING_REF mRequest;
|
2017-05-25 20:50:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace dom
|
|
|
|
} // end of namespace mozilla
|
|
|
|
|
|
|
|
#endif
|