diff --git a/mobile/android/base/restrictions/RestrictedProfileConfiguration.java b/mobile/android/base/restrictions/RestrictedProfileConfiguration.java index a75af7d5c39..b23f8a71027 100644 --- a/mobile/android/base/restrictions/RestrictedProfileConfiguration.java +++ b/mobile/android/base/restrictions/RestrictedProfileConfiguration.java @@ -30,7 +30,8 @@ public class RestrictedProfileConfiguration implements RestrictionConfiguration Restriction.DISALLOW_DISPLAY_SETTINGS, Restriction.DISALLOW_CLEAR_HISTORY, Restriction.DISALLOW_MASTER_PASSWORD, - Restriction.DISALLOW_GUEST_BROWSING + Restriction.DISALLOW_GUEST_BROWSING, + Restriction.DISALLOW_DEFAULT_THEME ); private Context context; diff --git a/mobile/android/base/restrictions/Restriction.java b/mobile/android/base/restrictions/Restriction.java index f53c8b3c0e1..c073baad44a 100644 --- a/mobile/android/base/restrictions/Restriction.java +++ b/mobile/android/base/restrictions/Restriction.java @@ -54,8 +54,9 @@ public enum Restriction { DISALLOW_MASTER_PASSWORD(18, "no_master_password", R.string.restriction_disallow_master_password_title), - DISALLOW_GUEST_BROWSING(19, "no_guest_browsing", R.string.restriction_disallow_guest_browsing_title); + DISALLOW_GUEST_BROWSING(19, "no_guest_browsing", R.string.restriction_disallow_guest_browsing_title), + DISALLOW_DEFAULT_THEME(20, "no_default_theme", 0); public final int id; public final String name; diff --git a/mobile/android/base/restrictions/RestrictionProvider.java b/mobile/android/base/restrictions/RestrictionProvider.java index d69427576e3..c21f8477e94 100644 --- a/mobile/android/base/restrictions/RestrictionProvider.java +++ b/mobile/android/base/restrictions/RestrictionProvider.java @@ -58,6 +58,11 @@ public class RestrictionProvider extends BroadcastReceiver { continue; } + if (restriction == Restriction.DISALLOW_DEFAULT_THEME) { + // This restriction is not configurable + continue; + } + RestrictionEntry entry = createRestrictionEntryWithDefaultValue(context, restriction, oldRestrictions.getBoolean(restriction.name, true)); entries.add(entry); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 7e7b2445c00..601cc2ded86 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -3080,7 +3080,10 @@ var LightWeightThemeWebInstaller = { BrowserApp.deck.addEventListener("PreviewBrowserTheme", this, false, true); BrowserApp.deck.addEventListener("ResetBrowserThemePreview", this, false, true); - if (ParentalControls.parentalControlsEnabled && !this._manager.currentTheme) { + if (ParentalControls.parentalControlsEnabled && + !this._manager.currentTheme && + !ParentalControls.isAllowed(ParentalControls.DEFAULT_THEME)) { + // We are using the DEFAULT_THEME restriction to differentiate between restricted profiles & guest mode - Bug 1199596 this._installParentalControlsTheme(); } }, diff --git a/toolkit/components/parentalcontrols/nsIParentalControlsService.idl b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl index 0c4f413394a..c0b071db7b0 100644 --- a/toolkit/components/parentalcontrols/nsIParentalControlsService.idl +++ b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl @@ -11,7 +11,7 @@ interface nsIFile; interface nsIInterfaceRequestor; interface nsIArray; -[scriptable, uuid(ed14d186-e902-4d41-86cb-8949fd7b53d7)] +[scriptable, uuid(f9962e65-5369-4346-8c44-84d5319abfc2)] interface nsIParentalControlsService : nsISupports { /** @@ -36,6 +36,7 @@ interface nsIParentalControlsService : nsISupports const short CLEAR_HISTORY = 17; // Clear browsing history const short MASTER_PASSWORD = 18; // Setting master password for logins const short GUEST_BROWSING = 19; // Disallow usage of guest browsing + const short DEFAULT_THEME = 20; // Use default theme or a special parental controls theme /** * @returns true if the current user account has parental controls