Backed out 2 changesets (bug 1580567, bug 1599927) for causing permafailures in dom/tests/mochitest/general/test_interfaces.html CLOSED TREE

Backed out changeset aeceec922866 (bug 1599927)
Backed out changeset 29809135f18e (bug 1580567)
This commit is contained in:
shindli
2019-12-11 03:32:44 +02:00
parent 0aa47af90e
commit 9d142fdc1b
47 changed files with 89 additions and 630 deletions

View File

@@ -833,111 +833,6 @@ GeolocationPermissionPrompt.prototype = {
PermissionUI.GeolocationPermissionPrompt = GeolocationPermissionPrompt;
/**
* Creates a PermissionPrompt for a nsIContentPermissionRequest for
* the WebXR API.
*
* @param request (nsIContentPermissionRequest)
* The request for a permission from content.
*/
function XRPermissionPrompt(request) {
this.request = request;
}
XRPermissionPrompt.prototype = {
__proto__: PermissionPromptForRequestPrototype,
get type() {
return "xr";
},
get permissionKey() {
return "xr";
},
get popupOptions() {
let pref = "browser.xr.warning.infoURL";
let options = {
learnMoreURL: Services.urlFormatter.formatURLPref(pref),
displayURI: false,
name: this.getPrincipalName(),
};
if (this.principal.URI.schemeIs("file")) {
options.checkbox = { show: false };
} else {
// Don't offer "always remember" action in PB mode
options.checkbox = {
show: !PrivateBrowsingUtils.isWindowPrivate(this.browser.ownerGlobal),
};
}
if (options.checkbox.show) {
options.checkbox.label = gBrowserBundle.GetStringFromName("xr.remember");
}
return options;
},
get notificationID() {
return "xr";
},
get anchorID() {
return "xr-notification-icon";
},
get message() {
if (this.principal.URI.schemeIs("file")) {
return gBrowserBundle.GetStringFromName("xr.shareWithFile3");
}
return gBrowserBundle.formatStringFromName("xr.shareWithSite3", ["<>"]);
},
get promptActions() {
return [
{
label: gBrowserBundle.GetStringFromName("xr.allow"),
accessKey: gBrowserBundle.GetStringFromName("xr.allow.accesskey"),
action: SitePermissions.ALLOW,
},
{
label: gBrowserBundle.GetStringFromName("xr.dontAllow"),
accessKey: gBrowserBundle.GetStringFromName("xr.dontAllow.accesskey"),
action: SitePermissions.BLOCK,
},
];
},
_updateXRSharing(state) {
let gBrowser = this.browser.ownerGlobal.gBrowser;
if (gBrowser == null) {
return;
}
gBrowser.updateBrowserSharing(this.browser, { xr: state });
let devicePermOrigins = this.browser.getDevicePermissionOrigins("xr");
if (!state) {
devicePermOrigins.delete(this.principal.origin);
return;
}
devicePermOrigins.add(this.principal.origin);
},
allow(...args) {
this._updateXRSharing(true);
PermissionPromptForRequestPrototype.allow.apply(this, args);
},
cancel(...args) {
this._updateXRSharing(false);
PermissionPromptForRequestPrototype.cancel.apply(this, args);
},
};
PermissionUI.XRPermissionPrompt = XRPermissionPrompt;
/**
* Creates a PermissionPrompt for a nsIContentPermissionRequest for
* the Desktop Notification API.