mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 853356 - gUM video prompt for Contact API prompt. r=fabrice
This commit is contained in:
parent
3a4bbe0a0b
commit
bbd218f9fe
@ -74,10 +74,18 @@ this.PermissionPromptHelper = {
|
||||
}
|
||||
|
||||
if (permValue == Ci.nsIPermissionManager.PROMPT_ACTION) {
|
||||
// create a nsIContentPermissionRequest
|
||||
let request = {
|
||||
// create an array with a nsIContentPermissionType element
|
||||
let type = {
|
||||
type: msg.type,
|
||||
access: msg.access ? msg.access : "unused",
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionType])
|
||||
};
|
||||
let typeArray = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
||||
typeArray.appendElement(type, false);
|
||||
|
||||
// create a nsIContentPermissionRequest
|
||||
let request = {
|
||||
types: typeArray,
|
||||
principal: principal,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionRequest]),
|
||||
allow: aCallbacks.allow,
|
||||
|
@ -68,8 +68,16 @@ PermissionPromptService.prototype = {
|
||||
+ "2nd argument must be type 'nsIContentPermissionRequest'");
|
||||
}
|
||||
|
||||
let type = aRequest.access !== "unused" ? aRequest.type + "-" + aRequest.access
|
||||
: aRequest.type;
|
||||
// Only allow exactly one permission request here.
|
||||
let types = aRequest.types.QueryInterface(Ci.nsIArray);
|
||||
if (types.length != 1) {
|
||||
aRequest.cancel();
|
||||
return;
|
||||
}
|
||||
let reqType = types.queryElementAt(0, Ci.nsIContentPermissionType);
|
||||
|
||||
let type = reqType.access !== "unused" ? reqType.type + "-" + reqType.access
|
||||
: reqType.type;
|
||||
let perm =
|
||||
permissionManager.testExactPermissionFromPrincipal(aRequest.principal, type);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user