mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1134553 - Disable downloads in guest session. r=rnewman
This commit is contained in:
parent
4e08a02354
commit
5a7457bdc4
@ -16,6 +16,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "Notifications", "resource://gre/modules
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "ParentalControls",
|
||||
"@mozilla.org/parental-controls-service;1", "nsIParentalControlsService");
|
||||
|
||||
let Log = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.i.bind(null, "DownloadNotifications");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "strings",
|
||||
@ -58,6 +61,13 @@ var DownloadNotifications = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ParentalControls.isAllowed(ParentalControls.DOWNLOAD)) {
|
||||
download.cancel().catch(Cu.reportError);
|
||||
download.removePartialData().catch(Cu.reportError);
|
||||
window.NativeWindow.toast.show(strings.GetStringFromName("downloads.disabledInGuest"), "long");
|
||||
return;
|
||||
}
|
||||
|
||||
let notification = new DownloadNotification(download);
|
||||
notifications.set(download, notification);
|
||||
notification.showOrUpdate();
|
||||
|
Loading…
Reference in New Issue
Block a user