nsIOSPermissionRequest.idl (2731B)
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/. */ 6 7 #include "nsISupports.idl" 8 9 [scriptable, uuid(95790842-75a0-430d-98bf-f5ce3788ea6d)] 10 interface nsIOSPermissionRequest: nsISupports 11 { 12 /* 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. 17 */ 18 const uint16_t PERMISSION_STATE_NOTDETERMINED = 0; 19 20 /* A policy prevents the application from accessing the resource */ 21 const uint16_t PERMISSION_STATE_RESTRICTED = 1; 22 23 /* Access to the resource is denied */ 24 const uint16_t PERMISSION_STATE_DENIED = 2; 25 26 /* Access to the resource is allowed */ 27 const uint16_t PERMISSION_STATE_AUTHORIZED = 3; 28 29 /* Get the permission state for both audio and video capture */ 30 void getMediaCapturePermissionState(out uint16_t aVideo, 31 out uint16_t aAudio); 32 33 /* Get the permission state for audio capture */ 34 void getAudioCapturePermissionState(out uint16_t aAudio); 35 36 /* Get the permission state for video capture */ 37 void getVideoCapturePermissionState(out uint16_t aVideo); 38 39 /* Get the permission state for screen capture */ 40 void getScreenCapturePermissionState(out uint16_t aScreen); 41 42 /* 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. 48 */ 49 [implicit_jscontext, must_use] 50 Promise requestVideoCapturePermission(); 51 52 /* 53 * Request permission to access audio capture devices. Returns a 54 * promise with the same semantics as |requestVideoCapturePermission|. 55 */ 56 [implicit_jscontext, must_use] 57 Promise requestAudioCapturePermission(); 58 59 /* 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. 67 */ 68 void maybeRequestScreenCapturePermission(); 69 };