Bug 1860712 [wpt PR 42705] - Port popover test to WPT and adjust for close requests...
[gecko.git] / dom / system / nsIOSPermissionRequest.idl
blobe0d7b531c77723ad32cd6f40037b0f306e66c0f9
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* vim: set ts=2 et sw=2 tw=40: */
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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 [scriptable, uuid(95790842-75a0-430d-98bf-f5ce3788ea6d)]
10 interface nsIOSPermissionRequest: nsISupports
13 * The permission state is not known. As an example, on macOS
14 * this is used to indicate the user has not been prompted to
15 * authorize or deny access and there is no policy in place to
16 * deny access.
18 const uint16_t PERMISSION_STATE_NOTDETERMINED = 0;
20 /* A policy prevents the application from accessing the resource */
21 const uint16_t PERMISSION_STATE_RESTRICTED = 1;
23 /* Access to the resource is denied */
24 const uint16_t PERMISSION_STATE_DENIED = 2;
26 /* Access to the resource is allowed */
27 const uint16_t PERMISSION_STATE_AUTHORIZED = 3;
29 /* Get the permission state for both audio and video capture */
30 void getMediaCapturePermissionState(out uint16_t aVideo,
31 out uint16_t aAudio);
33 /* Get the permission state for audio capture */
34 void getAudioCapturePermissionState(out uint16_t aAudio);
36 /* Get the permission state for video capture */
37 void getVideoCapturePermissionState(out uint16_t aVideo);
39 /* Get the permission state for screen capture */
40 void getScreenCapturePermissionState(out uint16_t aScreen);
43 * Request permission to access video capture devices. Returns a
44 * promise that resolves with |true| after the browser has been
45 * granted permission to capture video. If capture access is denied,
46 * the promise is resolved with |false|. The promise is rejected if
47 * an error occurs.
49 [implicit_jscontext, must_use]
50 Promise requestVideoCapturePermission();
53 * Request permission to access audio capture devices. Returns a
54 * promise with the same semantics as |requestVideoCapturePermission|.
56 [implicit_jscontext, must_use]
57 Promise requestAudioCapturePermission();
60 * Request permission to capture the screen using an unreliable method.
61 * Attemps to trigger a screen capture permission dialog. Whether or not
62 * the dialog is displayed and whether or not the user grants permission
63 * to record the screen is not available to the caller. This method has
64 * limited utility because it does not block to wait for a dialog
65 * prompt or the user's reponse if a dialog is displayed. And the dialog
66 * is not guaranteed to be displayed per OS restrictions.
68 void maybeRequestScreenCapturePermission();