XRPermissionRequest.h (1224B)
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::dom { 15 16 /** 17 * Handles permission dialog management when requesting XR device access. 18 */ 19 class XRPermissionRequest final : public ContentPermissionRequestBase { 20 public: 21 XRPermissionRequest(nsPIDOMWindowInner* aWindow, uint64_t aWindowId); 22 23 NS_DECL_ISUPPORTS_INHERITED 24 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XRPermissionRequest, 25 ContentPermissionRequestBase) 26 // nsIContentPermissionRequest 27 NS_IMETHOD Cancel(void) override; 28 NS_IMETHOD Allow(JS::Handle<JS::Value> choices) override; 29 nsresult Start(); 30 31 private: 32 ~XRPermissionRequest() = default; 33 34 uint64_t mWindowId; 35 }; 36 37 } // namespace mozilla::dom 38 39 #endif // mozilla_dom_XR_h_