mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-24 16:54:08 +00:00
Bug 853356: gUM video prompt for Contact API prompt. r=fabrice
This commit is contained in:
parent
e16a400b48
commit
7729a4edfc
@ -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,17 @@ 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