Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
[gecko.git] / dom / events / RemoteDragStartData.h
blobdbf82d6cc0280703da699a414bbedd9f41909f87
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_dom_RemoteDragStartData_h
6 #define mozilla_dom_RemoteDragStartData_h
8 #include "nsCOMPtr.h"
9 #include "nsRect.h"
10 #include "mozilla/dom/DataTransfer.h"
11 #include "mozilla/dom/DOMTypes.h"
12 #include "mozilla/gfx/DataSurfaceHelpers.h"
14 class nsICookieJarSettings;
16 namespace mozilla {
17 namespace dom {
19 class IPCDataTransferItem;
20 class BrowserParent;
22 /**
23 * This class is used to hold information about a drag
24 * when a drag begins in a content process.
26 class RemoteDragStartData {
27 public:
28 NS_INLINE_DECL_REFCOUNTING(RemoteDragStartData)
30 RemoteDragStartData(BrowserParent* aBrowserParent,
31 nsTArray<IPCDataTransfer>&& aDataTransfer,
32 const LayoutDeviceIntRect& aRect,
33 nsIPrincipal* aPrincipal, nsIContentSecurityPolicy* aCsp,
34 nsICookieJarSettings* aCookieJarSettings);
36 void SetVisualization(
37 already_AddRefed<gfx::DataSourceSurface> aVisualization) {
38 mVisualization = aVisualization;
41 // Get the drag image and rectangle, clearing it from this
42 // RemoteDragStartData in the process.
43 already_AddRefed<mozilla::gfx::SourceSurface> TakeVisualization(
44 LayoutDeviceIntRect* aRect) {
45 *aRect = mRect;
46 return mVisualization.forget();
49 void AddInitialDnDDataTo(DataTransfer* aDataTransfer,
50 nsIPrincipal** aPrincipal,
51 nsIContentSecurityPolicy** aCsp,
52 nsICookieJarSettings** aCookieJarSettings);
54 private:
55 virtual ~RemoteDragStartData();
57 RefPtr<BrowserParent> mBrowserParent;
58 nsTArray<IPCDataTransfer> mDataTransfer;
59 const LayoutDeviceIntRect mRect;
60 nsCOMPtr<nsIPrincipal> mPrincipal;
61 nsCOMPtr<nsIContentSecurityPolicy> mCsp;
62 nsCOMPtr<nsICookieJarSettings> mCookieJarSettings;
63 RefPtr<mozilla::gfx::SourceSurface> mVisualization;
66 } // namespace dom
67 } // namespace mozilla
69 #endif // mozilla_dom_RemoteDragStartData_h