summaryrefslogtreecommitdiffstats
path: root/dom/system/nsIOSPermissionRequest.idl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/system/nsIOSPermissionRequest.idl
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/system/nsIOSPermissionRequest.idl')
-rw-r--r--dom/system/nsIOSPermissionRequest.idl69
1 files changed, 69 insertions, 0 deletions
diff --git a/dom/system/nsIOSPermissionRequest.idl b/dom/system/nsIOSPermissionRequest.idl
new file mode 100644
index 0000000000..e0d7b531c7
--- /dev/null
+++ b/dom/system/nsIOSPermissionRequest.idl
@@ -0,0 +1,69 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=40: */
+/* 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/. */
+
+#include "nsISupports.idl"
+
+[scriptable, uuid(95790842-75a0-430d-98bf-f5ce3788ea6d)]
+interface nsIOSPermissionRequest: nsISupports
+{
+ /*
+ * The permission state is not known. As an example, on macOS
+ * this is used to indicate the user has not been prompted to
+ * authorize or deny access and there is no policy in place to
+ * deny access.
+ */
+ const uint16_t PERMISSION_STATE_NOTDETERMINED = 0;
+
+ /* A policy prevents the application from accessing the resource */
+ const uint16_t PERMISSION_STATE_RESTRICTED = 1;
+
+ /* Access to the resource is denied */
+ const uint16_t PERMISSION_STATE_DENIED = 2;
+
+ /* Access to the resource is allowed */
+ const uint16_t PERMISSION_STATE_AUTHORIZED = 3;
+
+ /* Get the permission state for both audio and video capture */
+ void getMediaCapturePermissionState(out uint16_t aVideo,
+ out uint16_t aAudio);
+
+ /* Get the permission state for audio capture */
+ void getAudioCapturePermissionState(out uint16_t aAudio);
+
+ /* Get the permission state for video capture */
+ void getVideoCapturePermissionState(out uint16_t aVideo);
+
+ /* Get the permission state for screen capture */
+ void getScreenCapturePermissionState(out uint16_t aScreen);
+
+ /*
+ * Request permission to access video capture devices. Returns a
+ * promise that resolves with |true| after the browser has been
+ * granted permission to capture video. If capture access is denied,
+ * the promise is resolved with |false|. The promise is rejected if
+ * an error occurs.
+ */
+ [implicit_jscontext, must_use]
+ Promise requestVideoCapturePermission();
+
+ /*
+ * Request permission to access audio capture devices. Returns a
+ * promise with the same semantics as |requestVideoCapturePermission|.
+ */
+ [implicit_jscontext, must_use]
+ Promise requestAudioCapturePermission();
+
+ /*
+ * Request permission to capture the screen using an unreliable method.
+ * Attemps to trigger a screen capture permission dialog. Whether or not
+ * the dialog is displayed and whether or not the user grants permission
+ * to record the screen is not available to the caller. This method has
+ * limited utility because it does not block to wait for a dialog
+ * prompt or the user's reponse if a dialog is displayed. And the dialog
+ * is not guaranteed to be displayed per OS restrictions.
+ */
+ void maybeRequestScreenCapturePermission();
+};