1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_ClipboardWriteRequestParent_h
7 #define mozilla_ClipboardWriteRequestParent_h
9 #include "mozilla/PClipboardWriteRequestParent.h"
10 #include "nsIClipboard.h"
18 class ClipboardWriteRequestParent final
19 : public PClipboardWriteRequestParent
,
20 public nsIAsyncClipboardRequestCallback
{
21 using IPCResult
= mozilla::ipc::IPCResult
;
22 using ContentParent
= mozilla::dom::ContentParent
;
26 NS_DECL_NSIASYNCCLIPBOARDREQUESTCALLBACK
28 explicit ClipboardWriteRequestParent(ContentParent
* aManager
);
30 nsresult
Init(const nsIClipboard::ClipboardType aClipboardType
,
31 mozilla::dom::WindowContext
* aSettingWindowContext
);
33 IPCResult
RecvSetData(const IPCTransferable
& aTransferable
);
34 IPCResult
Recv__delete__(nsresult aReason
);
36 void ActorDestroy(ActorDestroyReason aReason
) override final
;
39 ~ClipboardWriteRequestParent();
41 RefPtr
<ContentParent
> mManager
;
42 nsCOMPtr
<nsIAsyncSetClipboardData
> mAsyncSetClipboardData
;
45 } // namespace mozilla
47 #endif // mozilla_ClipboardWriteRequestParent_h