Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim:set ts=2 sw=2 sts=2 et cindent: */
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 file,
5
* You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_XRPermissionRequest_h_
8
#define mozilla_dom_XRPermissionRequest_h_
9
10
#include "mozilla/dom/Promise.h"
11
#include "nsContentPermissionHelper.h"
12
#include "nsISupports.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
/**
18
* Handles permission dialog management when requesting XR device access.
19
*/
20
class XRPermissionRequest final : public ContentPermissionRequestBase {
21
public:
22
XRPermissionRequest(nsPIDOMWindowInner* aWindow, uint64_t aWindowId);
23
24
NS_DECL_ISUPPORTS_INHERITED
25
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XRPermissionRequest,
26
ContentPermissionRequestBase)
27
// nsIContentPermissionRequest
28
NS_IMETHOD Cancel(void) override;
29
NS_IMETHOD Allow(JS::HandleValue choices) override;
30
nsresult Start();
31
32
private:
33
~XRPermissionRequest() = default;
34
35
uint64_t mWindowId;
36
};
37
38
} // namespace dom
39
} // namespace mozilla
40
41
#endif // mozilla_dom_XR_h_