Bug 1046941 - "Disable downloads and extension installs in guest mode" [r=mark.finkle]
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -2755,17 +2755,17 @@ public class BrowserApp extends GeckoApp
}
}
// Disable share menuitem for about:, chrome:, file:, and resource: URIs
final boolean shareEnabled = RestrictedProfiles.isAllowed(RestrictedProfiles.Restriction.DISALLOW_SHARE);
share.setVisible(shareEnabled);
share.setEnabled(StringUtils.isShareableUrl(url) && shareEnabled);
MenuUtils.safeSetEnabled(aMenu, R.id.apps, RestrictedProfiles.isAllowed(RestrictedProfiles.Restriction.DISALLOW_INSTALL_APPS));
- MenuUtils.safeSetEnabled(aMenu, R.id.addons, RestrictedProfiles.isAllowed(RestrictedProfiles.Restriction.DISALLOW_INSTALL_EXTENSIONS));
+ MenuUtils.safeSetEnabled(aMenu, R.id.addons, RestrictedProfiles.isAllowed(RestrictedProfiles.Restriction.DISALLOW_INSTALL_EXTENSION));
MenuUtils.safeSetEnabled(aMenu, R.id.downloads, RestrictedProfiles.isAllowed(RestrictedProfiles.Restriction.DISALLOW_DOWNLOADS));
// NOTE: Use MenuUtils.safeSetEnabled because some actions might
// be on the BrowserToolbar context menu.
if (Versions.feature11Plus) {
MenuUtils.safeSetEnabled(aMenu, R.id.page, !isAboutHome(tab));
}
MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, tab.hasFeeds());
--- a/mobile/android/base/RestrictedProfiles.java
+++ b/mobile/android/base/RestrictedProfiles.java
@@ -50,17 +50,17 @@ public class RestrictedProfiles {
}};
/* This is a list of things we can restrict you from doing. Some of these are reflected in Android UserManager constants.
* Others are specific to us.
* These constants should be in sync with the ones from toolkit/components/parentalcontrols/nsIParentalControlServices.idl
*/
public static enum Restriction {
DISALLOW_DOWNLOADS(1, "no_download_files"),
- DISALLOW_INSTALL_EXTENSIONS(2, "no_install_extensions"),
+ DISALLOW_INSTALL_EXTENSION(2, "no_install_extensions"),
DISALLOW_INSTALL_APPS(3, "no_install_apps"), // UserManager.DISALLOW_INSTALL_APPS
DISALLOW_BROWSE_FILES(4, "no_browse_files"),
DISALLOW_SHARE(5, "no_share"),
DISALLOW_BOOKMARK(6, "no_bookmark"),
DISALLOW_ADD_CONTACTS(7, "no_add_contacts"),
DISALLOW_SET_IMAGE(8, "no_set_image"),
DISALLOW_MODIFY_ACCOUNTS(9, "no_modify_accounts"), // UserManager.DISALLOW_MODIFY_ACCOUNTS
DISALLOW_REMOTE_DEBUGGING(10, "no_remote_debugging"),
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -460,17 +460,17 @@ var BrowserApp = {
// Broadcast a UIReady message so add-ons know we are finished with startup
let event = document.createEvent("Events");
event.initEvent("UIReady", true, false);
window.dispatchEvent(event);
if (this._startupStatus)
this.onAppUpdated();
- if (!ParentalControls.isAllowed(ParentalControls.INSTALL_EXTENSIONS)) {
+ if (!ParentalControls.isAllowed(ParentalControls.INSTALL_EXTENSION)) {
// Disable extension installs
Services.prefs.setIntPref("extensions.enabledScopes", 1);
Services.prefs.setIntPref("extensions.autoDisableScopes", 1);
Services.prefs.setBoolPref("xpinstall.enabled", false);
}
// notify java that gecko has loaded
Messaging.sendRequest({ type: "Gecko:Ready" });