Bug 1189336 - (Part 3) Move from a list of disallowed things to a list of restrictable features. r=ally
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 11 Nov 2015 18:17:19 +0100
changeset 310444 6d38b37d27a44859fcda808e8c7f17980da88376
parent 310443 82cd040777655c08b79aca030a9bd885c8fd9d88
child 310445 2a711953a62c00ee3ddc753592ccffac7876c966
push id1040
push userraliiev@mozilla.com
push dateMon, 29 Feb 2016 17:11:22 +0000
treeherdermozilla-release@8c3167321162 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally
bugs1189336
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1189336 - (Part 3) Move from a list of disallowed things to a list of restrictable features. r=ally
mobile/android/base/AccountsHelper.java
mobile/android/base/BrowserApp.java
mobile/android/base/Restrictions.java
mobile/android/base/home/HistoryPanel.java
mobile/android/base/home/HomeConfigPrefsBackend.java
mobile/android/base/home/HomeFragment.java
mobile/android/base/home/TopSitesPanel.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/preferences/AndroidImportPreference.java
mobile/android/base/preferences/GeckoPreferences.java
mobile/android/base/restrictions/GuestProfileConfiguration.java
mobile/android/base/restrictions/Restrictable.java
mobile/android/base/restrictions/RestrictedProfileConfiguration.java
mobile/android/base/restrictions/RestrictionProvider.java
mobile/android/base/strings.xml.in
mobile/android/base/tabs/TabsPanel.java
mobile/android/chrome/content/browser.js
mobile/android/tests/browser/chrome/test_restricted_profiles.html
toolkit/components/parentalcontrols/nsIParentalControlsService.idl
--- a/mobile/android/base/AccountsHelper.java
+++ b/mobile/android/base/AccountsHelper.java
@@ -78,17 +78,17 @@ public class AccountsHelper implements N
                 "Accounts:DeleteFirefoxAccount",
                 "Accounts:Exist",
                 "Accounts:ProfileUpdated",
                 "Accounts:ShowSyncPreferences");
     }
 
     @Override
     public void handleMessage(String event, NativeJSObject message, final EventCallback callback) {
-        if (!Restrictions.isAllowed(mContext, Restrictable.DISALLOW_MODIFY_ACCOUNTS)) {
+        if (!Restrictions.isAllowed(mContext, Restrictable.MODIFY_ACCOUNTS)) {
             // We register for messages in all contexts; we drop, with a log and an error to JavaScript,
             // when the profile is restricted.  It's better to return errors than silently ignore messages.
             Log.e(LOGTAG, "Profile is not allowed to modify accounts!  Ignoring event: " + event);
             if (callback != null) {
                 callback.sendError("Profile is not allowed to modify accounts!");
             }
             return;
         }
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1788,17 +1788,17 @@ public class BrowserApp extends GeckoApp
                                 getSupportFragmentManager().beginTransaction().disallowAddToBackStack().add(mpm, tag).commit();
                             }
                         } catch (Exception ex) {
                             Log.e(LOGTAG, "Error initializing media manager", ex);
                         }
                     }
                 }
 
-                if (AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED && Restrictions.isAllowed(this, Restrictable.DISALLOW_LOCATION_SERVICE)) {
+                if (AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED && Restrictions.isAllowed(this, Restrictable.LOCATION_SERVICE)) {
                     // Start (this acts as ping if started already) the stumbler lib; if the stumbler has queued data it will upload it.
                     // Stumbler operates on its own thread, and startup impact is further minimized by delaying work (such as upload) a few seconds.
                     // Avoid any potential startup CPU/thread contention by delaying the pref broadcast.
                     final long oneSecondInMillis = 1000;
                     ThreadUtils.getBackgroundHandler().postDelayed(new Runnable() {
                         @Override
                         public void run() {
                              GeckoPreferences.broadcastStumblerPref(BrowserApp.this);
@@ -3079,21 +3079,21 @@ public class BrowserApp extends GeckoApp
         if (AboutPages.isAboutReader(url)) {
             String urlFromReader = ReaderModeUtils.getUrlFromAboutReader(url);
             if (urlFromReader != null) {
                 url = urlFromReader;
             }
         }
 
         // Disable share menuitem for about:, chrome:, file:, and resource: URIs
-        final boolean shareVisible = Restrictions.isAllowed(this, Restrictable.DISALLOW_SHARE);
+        final boolean shareVisible = Restrictions.isAllowed(this, Restrictable.SHARE);
         share.setVisible(shareVisible);
         final boolean shareEnabled = StringUtils.isShareableUrl(url) && shareVisible;
         share.setEnabled(shareEnabled);
-        MenuUtils.safeSetEnabled(aMenu, R.id.downloads, Restrictions.isAllowed(this, Restrictable.DISALLOW_DOWNLOADS));
+        MenuUtils.safeSetEnabled(aMenu, R.id.downloads, Restrictions.isAllowed(this, Restrictable.DOWNLOAD));
 
         // 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());
         MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, tab.hasOpenSearch());
@@ -3146,17 +3146,17 @@ public class BrowserApp extends GeckoApp
 
                             shareIntent.putExtra("share_screenshot_uri", Uri.parse(outFile.getPath()));
                         }
                     }
                 }
             }
         }
 
-        final boolean privateTabVisible = Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING);
+        final boolean privateTabVisible = Restrictions.isAllowed(this, Restrictable.PRIVATE_BROWSING);
         MenuUtils.safeSetVisible(aMenu, R.id.new_private_tab, privateTabVisible);
 
         // Disable PDF generation (save and print) for about:home and xul pages.
         boolean allowPDF = (!(isAboutHome(tab) ||
                                tab.getContentType().equals("application/vnd.mozilla.xul+xml") ||
                                tab.getContentType().startsWith("video/")));
         saveAsPDF.setEnabled(allowPDF);
         print.setEnabled(allowPDF);
@@ -3168,21 +3168,21 @@ public class BrowserApp extends GeckoApp
         charEncoding.setVisible(GeckoPreferences.getCharEncodingState());
 
         if (mProfile.inGuestMode()) {
             exitGuestMode.setVisible(true);
         } else {
             enterGuestMode.setVisible(true);
         }
 
-        if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_GUEST_BROWSING)) {
+        if (!Restrictions.isAllowed(this, Restrictable.GUEST_BROWSING)) {
             MenuUtils.safeSetVisible(aMenu, R.id.new_guest_session, false);
         }
 
-        if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_INSTALL_EXTENSION)) {
+        if (!Restrictions.isAllowed(this, Restrictable.INSTALL_EXTENSION)) {
             MenuUtils.safeSetVisible(aMenu, R.id.addons, false);
         }
 
         return true;
     }
 
     private int resolveBookmarkIconID(final boolean isBookmark) {
         if (isBookmark) {
--- a/mobile/android/base/Restrictions.java
+++ b/mobile/android/base/Restrictions.java
@@ -118,15 +118,15 @@ public class Restrictions {
             // Unknown actions represent a coding error, so we
             // refuse the action and log.
             Log.e(LOGTAG, "Unknown action " + action + "; check calling code.");
             return false;
         }
 
         final Context context = GeckoAppShell.getApplicationContext();
 
-        if (Restrictable.DISALLOW_BROWSE_FILES == restrictable) {
+        if (Restrictable.BROWSE == restrictable) {
             return canLoadUrl(context, url);
         } else {
             return isAllowed(context, restrictable);
         }
     }
 }
--- a/mobile/android/base/home/HistoryPanel.java
+++ b/mobile/android/base/home/HistoryPanel.java
@@ -219,17 +219,17 @@ public class HistoryPanel extends HomeFr
             }
         });
     }
 
     @Override
     public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) {
         super.onCreateContextMenu(menu, view, menuInfo);
 
-        if (!Restrictions.isAllowed(getActivity(), Restrictable.DISALLOW_CLEAR_HISTORY)) {
+        if (!Restrictions.isAllowed(getActivity(), Restrictable.CLEAR_HISTORY)) {
             menu.findItem(R.id.home_remove).setVisible(false);
         }
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
 
@@ -286,17 +286,17 @@ public class HistoryPanel extends HomeFr
 
     @Override
     protected void load() {
         getLoaderManager().initLoader(LOADER_ID_HISTORY, null, mCursorLoaderCallbacks);
     }
 
     private void updateUiFromCursor(Cursor c) {
         if (c != null && c.getCount() > 0) {
-            if (Restrictions.isAllowed(getActivity(), Restrictable.DISALLOW_CLEAR_HISTORY)) {
+            if (Restrictions.isAllowed(getActivity(), Restrictable.CLEAR_HISTORY)) {
                 mClearHistoryButton.setVisibility(View.VISIBLE);
             }
             return;
         }
 
         // Cursor is empty, so hide the "Clear browsing history" button,
         // and set the empty view if it hasn't been set already.
         mClearHistoryButton.setVisibility(View.GONE);
@@ -317,17 +317,17 @@ public class HistoryPanel extends HomeFr
 
             final SpannableStringBuilder hintBuilder = formatHintText(hintText);
             if (hintBuilder != null) {
                 emptyHint.setText(hintBuilder);
                 emptyHint.setMovementMethod(LinkMovementMethod.getInstance());
                 emptyHint.setVisibility(View.VISIBLE);
             }
 
-            if (!Restrictions.isAllowed(getActivity(), Restrictable.DISALLOW_PRIVATE_BROWSING)) {
+            if (!Restrictions.isAllowed(getActivity(), Restrictable.PRIVATE_BROWSING)) {
                 emptyHint.setVisibility(View.GONE);
             }
 
             mList.setEmptyView(mEmptyView);
         }
     }
 
     /**
--- a/mobile/android/base/home/HomeConfigPrefsBackend.java
+++ b/mobile/android/base/home/HomeConfigPrefsBackend.java
@@ -72,17 +72,17 @@ class HomeConfigPrefsBackend implements 
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.TOP_SITES,
                                                   EnumSet.of(PanelConfig.Flags.DEFAULT_PANEL)));
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.BOOKMARKS));
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.HISTORY));
 
         // We disable Synced Tabs for guest mode / restricted profiles.
-        if (Restrictions.isAllowed(mContext, Restrictable.DISALLOW_MODIFY_ACCOUNTS)) {
+        if (Restrictions.isAllowed(mContext, Restrictable.MODIFY_ACCOUNTS)) {
             panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.REMOTE_TABS));
         }
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.RECENT_TABS));
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.READING_LIST));
 
         return new State(panelConfigs, true);
     }
--- a/mobile/android/base/home/HomeFragment.java
+++ b/mobile/android/base/home/HomeFragment.java
@@ -148,17 +148,17 @@ public abstract class HomeFragment exten
         if (!info.canRemove()) {
             menu.findItem(R.id.home_remove).setVisible(false);
         }
 
         if (!StringUtils.isShareableUrl(info.url) || GeckoProfile.get(getActivity()).inGuestMode()) {
             menu.findItem(R.id.home_share).setVisible(false);
         }
 
-        if (!Restrictions.isAllowed(view.getContext(), Restrictable.DISALLOW_PRIVATE_BROWSING)) {
+        if (!Restrictions.isAllowed(view.getContext(), Restrictable.PRIVATE_BROWSING)) {
             menu.findItem(R.id.home_open_private_tab).setVisible(false);
         }
 
         menu.findItem(R.id.mark_read).setVisible(info.isInReadingList() && info.isUnread);
         menu.findItem(R.id.mark_unread).setVisible(info.isInReadingList() && !info.isUnread);
     }
 
     @Override
--- a/mobile/android/base/home/TopSitesPanel.java
+++ b/mobile/android/base/home/TopSitesPanel.java
@@ -338,33 +338,33 @@ public class TopSitesPanel extends HomeF
             return;
         }
 
         if (!(menuInfo instanceof TopSitesGridContextMenuInfo)) {
             // Long pressed item was not a Top Sites GridView item. Superclass
             // can handle this.
             super.onCreateContextMenu(menu, view, menuInfo);
 
-            if (!Restrictions.isAllowed(view.getContext(), Restrictable.DISALLOW_CLEAR_HISTORY)) {
+            if (!Restrictions.isAllowed(view.getContext(), Restrictable.CLEAR_HISTORY)) {
                 menu.findItem(R.id.home_remove).setVisible(false);
             }
 
             return;
         }
 
         final Context context = view.getContext();
 
         // Long pressed item was a Top Sites GridView item, handle it.
         MenuInflater inflater = new MenuInflater(context);
         inflater.inflate(R.menu.home_contextmenu, menu);
 
         // Hide unused menu items.
         menu.findItem(R.id.home_edit_bookmark).setVisible(false);
 
-        menu.findItem(R.id.home_remove).setVisible(Restrictions.isAllowed(context, Restrictable.DISALLOW_CLEAR_HISTORY));
+        menu.findItem(R.id.home_remove).setVisible(Restrictions.isAllowed(context, Restrictable.CLEAR_HISTORY));
 
         TopSitesGridContextMenuInfo info = (TopSitesGridContextMenuInfo) menuInfo;
         menu.setHeaderTitle(info.getDisplayTitle());
 
         if (info.type != TopSites.TYPE_BLANK) {
             if (info.type == TopSites.TYPE_PINNED) {
                 menu.findItem(R.id.top_sites_pin).setVisible(false);
             } else {
@@ -376,17 +376,17 @@ public class TopSitesPanel extends HomeF
             menu.findItem(R.id.top_sites_pin).setVisible(false);
             menu.findItem(R.id.top_sites_unpin).setVisible(false);
         }
 
         if (!StringUtils.isShareableUrl(info.url) || GeckoProfile.get(getActivity()).inGuestMode()) {
             menu.findItem(R.id.home_share).setVisible(false);
         }
 
-        if (!Restrictions.isAllowed(context, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
+        if (!Restrictions.isAllowed(context, Restrictable.PRIVATE_BROWSING)) {
             menu.findItem(R.id.home_open_private_tab).setVisible(false);
         }
 
         // We only show these menu items on the reading list panel:
         menu.findItem(R.id.mark_read).setVisible(false);
         menu.findItem(R.id.mark_unread).setVisible(false);
     }
 
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -708,27 +708,27 @@ just addresses the organization to follo
 <!-- DevTools Authentication -->
 <!-- LOCALIZATION NOTE (devtools_auth_scan_header): This header text appears
      above a QR reader that is actively scanning for QR codes.  The expected QR
      code has already been displayed by the client trying to connect (such as
      desktop Firefox via WebIDE), so you just need to aim this device at the QR
      code. -->
 <!ENTITY devtools_auth_scan_header "Scanning for the QR code displayed on your other device">
 
-<!-- Restrictions -->
-<!-- Localization note: These are restrictions the device owner (e.g. parent) can enable for
+<!-- Restrictable features -->
+<!-- Localization note: These are features the device owner (e.g. parent) can enable or disable for
      a restricted profile (e.g. child). Used inside the Android settings UI. -->
-<!ENTITY restriction_disallow_addons_title2 "Disable add-on installation">
-<!ENTITY restriction_disallow_private_browsing_title2 "Disable Private Browsing">
-<!ENTITY restriction_disallow_location_services_title2 "Disable Location Services">
-<!ENTITY restriction_disallow_clear_history_title2 "Disable \'Clear browsing history\'">
-<!ENTITY restriction_disallow_master_password_title2 "Disable master password">
-<!ENTITY restriction_disallow_guest_browsing_title2 "Disable Guest Browsing">
-<!ENTITY restriction_disallow_advanced_settings_title "Disable Advanced Settings">
-<!ENTITY restriction_disallow_camera_microphone_title "Block camera and microphone">
+<!ENTITY restrictable_feature_addons_installation "Add-ons">
+<!ENTITY restrictable_feature_private_browsing "Private Browsing">
+<!ENTITY restrictable_feature_location_services "Location Services">
+<!ENTITY restrictable_feature_clear_history "Clear History">
+<!ENTITY restrictable_feature_guest_browsing "Guest browsing">
+<!ENTITY restrictable_feature_master_password "Master password">
+<!ENTITY restrictable_feature_advanced_settings "Advanced Settings">
+<!ENTITY restrictable_feature_camera_microphone "Camera &amp; Microphone">
 
 <!-- Default Bookmarks titles-->
 <!-- LOCALIZATION NOTE (bookmarks_about_browser): link title for about:fennec -->
 <!ENTITY bookmarks_about_browser "Firefox: About your browser">
 <!-- LOCALIZATION NOTE (bookmarks_addons): link title for https://addons.mozilla.org/en-US/mobile -->
 <!ENTITY bookmarks_addons "Firefox: Customize with add-ons">
 <!-- LOCALIZATION NOTE (bookmarks_support): link title for https://support.mozilla.org/ -->
 <!ENTITY bookmarks_support "Firefox: Support">
--- a/mobile/android/base/preferences/AndroidImportPreference.java
+++ b/mobile/android/base/preferences/AndroidImportPreference.java
@@ -23,17 +23,17 @@ class AndroidImportPreference extends Mu
     private static final String LOGTAG = "AndroidImport";
     public static final String PREF_KEY = "android.not_a_preference.import_android";
     private static final String PREF_KEY_PREFIX = "import_android.data.";
     private final Context mContext;
 
     public static class Handler implements GeckoPreferences.PrefHandler {
         public boolean setupPref(Context context, Preference pref) {
             // Feature disabled on devices running Android M+ (Bug 1183559)
-            return Versions.preM && Restrictions.isAllowed(context, Restrictable.DISALLOW_IMPORT_SETTINGS);
+            return Versions.preM && Restrictions.isAllowed(context, Restrictable.IMPORT_SETTINGS);
         }
 
         public void onChange(Context context, Preference pref, Object newValue) { }
     }
 
     public AndroidImportPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = context;
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -458,17 +458,17 @@ OnSharedPreferenceChangeListener
         if (onIsMultiPane()) {
             loadHeadersFromResource(R.xml.preference_headers, target);
 
             Iterator<Header> iterator = target.iterator();
 
             while (iterator.hasNext()) {
                 Header header = iterator.next();
 
-                if (header.id == R.id.pref_header_advanced && !Restrictions.isAllowed(this, Restrictable.DISALLOW_ADVANCED_SETTINGS)) {
+                if (header.id == R.id.pref_header_advanced && !Restrictions.isAllowed(this, Restrictable.ADVANCED_SETTINGS)) {
                     iterator.remove();
                 }
             }
 
             mHeaders = target;
         }
     }
 
@@ -673,33 +673,33 @@ OnSharedPreferenceChangeListener
                 // If datareporting is disabled, remove UI.
                 if (PREFS_DATA_REPORTING_PREFERENCES.equals(key)) {
                     if (!AppConstants.MOZ_DATA_REPORTING) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_SCREEN_ADVANCED.equals(key) &&
-                        !Restrictions.isAllowed(this, Restrictable.DISALLOW_ADVANCED_SETTINGS)) {
+                        !Restrictions.isAllowed(this, Restrictable.ADVANCED_SETTINGS)) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 }
                 setupPreferences((PreferenceGroup) pref, prefs);
             } else {
                 pref.setOnPreferenceChangeListener(this);
                 if (PREFS_UPDATER_AUTODOWNLOAD.equals(key)) {
                     if (!AppConstants.MOZ_UPDATER) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_OPEN_URLS_IN_PRIVATE.equals(key)) {
                     // Remove UI for opening external links in private browsing on non-Nightly builds.
-                    if (!AppConstants.NIGHTLY_BUILD || !Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
+                    if (!AppConstants.NIGHTLY_BUILD || !Restrictions.isAllowed(this, Restrictable.PRIVATE_BROWSING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_TRACKING_PROTECTION.equals(key)) {
                     // Remove UI for global TP pref in non-Nightly builds.
                     if (!AppConstants.NIGHTLY_BUILD) {
                         preferences.removePreference(pref);
@@ -729,59 +729,59 @@ OnSharedPreferenceChangeListener
                 } else if (PREFS_CRASHREPORTER_ENABLED.equals(key)) {
                     if (!AppConstants.MOZ_CRASHREPORTER) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_GEO_REPORTING.equals(key) ||
                            PREFS_GEO_LEARN_MORE.equals(key)) {
-                    if (!AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED || !Restrictions.isAllowed(this, Restrictable.DISALLOW_LOCATION_SERVICE)) {
+                    if (!AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED || !Restrictions.isAllowed(this, Restrictable.LOCATION_SERVICE)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_DEVTOOLS_REMOTE_USB_ENABLED.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_REMOTE_DEBUGGING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.REMOTE_DEBUGGING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_REMOTE_DEBUGGING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.REMOTE_DEBUGGING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                     if (!InputOptionsUtils.supportsQrCodeReader(getApplicationContext())) {
                         // WiFi debugging requires a QR code reader
                         pref.setEnabled(false);
                         pref.setSummary(getString(R.string.pref_developer_remotedebugging_wifi_disabled_summary));
                         continue;
                     }
                 } else if (PREFS_DEVTOOLS_REMOTE_LINK.equals(key)) {
                     // Remove the "Learn more" link if remote debugging is disabled
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_REMOTE_DEBUGGING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.REMOTE_DEBUGGING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_RESTORE_SESSION.equals(key) ||
                            PREFS_BROWSER_LOCALE.equals(key)) {
                     // Set the summary string to the current entry. The summary
                     // for other list prefs will be set in the PrefsHelper
                     // callback, but since this pref doesn't live in Gecko, we
                     // need to handle it separately.
                     ListPreference listPref = (ListPreference) pref;
                     CharSequence selectedEntry = listPref.getEntry();
                     listPref.setSummary(selectedEntry);
                     continue;
                 } else if (PREFS_SYNC.equals(key)) {
                     // Don't show sync prefs while in guest mode.
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_MODIFY_ACCOUNTS)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.MODIFY_ACCOUNTS)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_SEARCH_RESTORE_DEFAULTS.equals(key)) {
                     pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                         @Override
                         public boolean onPreferenceClick(Preference preference) {
@@ -814,41 +814,41 @@ OnSharedPreferenceChangeListener
                 } else if (PREFS_QRCODE_ENABLED.equals(key)) {
                     if (!InputOptionsUtils.supportsQrCodeReader(getApplicationContext())) {
                         // Remove UI for qr code input on non nightly builds
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_TRACKING_PROTECTION_PRIVATE_BROWSING.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.PRIVATE_BROWSING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_TRACKING_PROTECTION_LEARN_MORE.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.PRIVATE_BROWSING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_MP_ENABLED.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_MASTER_PASSWORD)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.MASTER_PASSWORD)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_CUSTOMIZE_IMAGE_BLOCKING.equals(key)) {
                     if (!AppConstants.NIGHTLY_BUILD) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_CLEAR_PRIVATE_DATA.equals(key) || PREFS_CLEAR_PRIVATE_DATA_EXIT.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_CLEAR_HISTORY)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.CLEAR_HISTORY)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_HOMEPAGE.equals(key)) {
                         String setUrl = GeckoSharedPrefs.forProfile(getBaseContext()).getString(PREFS_HOMEPAGE, AboutPages.HOME);
                         setHomePageSummary(pref, setUrl);
                         pref.setOnPreferenceChangeListener(this);
--- a/mobile/android/base/restrictions/GuestProfileConfiguration.java
+++ b/mobile/android/base/restrictions/GuestProfileConfiguration.java
@@ -9,28 +9,28 @@ import android.net.Uri;
 
 import java.util.Arrays;
 import java.util.List;
 
 /**
  * RestrictionConfiguration implementation for guest profiles.
  */
 public class GuestProfileConfiguration implements RestrictionConfiguration {
-    static List<Restrictable> DEFAULT_RESTRICTIONS = Arrays.asList(
-            Restrictable.DISALLOW_DOWNLOADS,
-            Restrictable.DISALLOW_INSTALL_EXTENSION,
-            Restrictable.DISALLOW_INSTALL_APPS,
-            Restrictable.DISALLOW_BROWSE_FILES,
-            Restrictable.DISALLOW_SHARE,
-            Restrictable.DISALLOW_BOOKMARK,
-            Restrictable.DISALLOW_ADD_CONTACTS,
-            Restrictable.DISALLOW_SET_IMAGE,
-            Restrictable.DISALLOW_MODIFY_ACCOUNTS,
-            Restrictable.DISALLOW_REMOTE_DEBUGGING,
-            Restrictable.DISALLOW_IMPORT_SETTINGS
+    static List<Restrictable> DISABLED_FEATURES = Arrays.asList(
+            Restrictable.DOWNLOAD,
+            Restrictable.INSTALL_EXTENSION,
+            Restrictable.INSTALL_APPS,
+            Restrictable.BROWSE,
+            Restrictable.SHARE,
+            Restrictable.BOOKMARK,
+            Restrictable.ADD_CONTACT,
+            Restrictable.SET_IMAGE,
+            Restrictable.MODIFY_ACCOUNTS,
+            Restrictable.REMOTE_DEBUGGING,
+            Restrictable.IMPORT_SETTINGS
     );
 
     @SuppressWarnings("serial")
     private static final List<String> BANNED_SCHEMES = Arrays.asList(
             "file",
             "chrome",
             "resource",
             "jar",
@@ -39,17 +39,17 @@ public class GuestProfileConfiguration i
 
     private static final List<String> BANNED_URLS = Arrays.asList(
             "about:config",
             "about:addons"
     );
 
     @Override
     public boolean isAllowed(Restrictable restrictable) {
-        return !DEFAULT_RESTRICTIONS.contains(restrictable);
+        return !DISABLED_FEATURES.contains(restrictable);
     }
 
     @Override
     public boolean canLoadUrl(String url) {
         // Null URLs are always permitted.
         if (url == null) {
             return true;
         }
--- a/mobile/android/base/restrictions/Restrictable.java
+++ b/mobile/android/base/restrictions/Restrictable.java
@@ -11,53 +11,53 @@ import android.content.Context;
 import android.support.annotation.StringRes;
 
 /**
  * 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/nsIParentalControlsService.idl
  */
 public enum Restrictable {
-    DISALLOW_DOWNLOADS(1, "no_download_files", 0),
+    DOWNLOAD(1, "downloads", 0),
 
-    DISALLOW_INSTALL_EXTENSION(2, "no_install_extensions", R.string.restriction_disallow_addons_title),
+    INSTALL_EXTENSION(2, "no_install_extensions", R.string.restrictable_feature_addons_installation),
 
     // UserManager.DISALLOW_INSTALL_APPS
-    DISALLOW_INSTALL_APPS(3, "no_install_apps", 0),
+    INSTALL_APPS(3, "no_install_apps", 0),
 
-    DISALLOW_BROWSE_FILES(4, "no_browse_files", 0),
+    BROWSE(4, "browse", 0),
 
-    DISALLOW_SHARE(5, "no_share", 0),
+    SHARE(5, "share", 0),
 
-    DISALLOW_BOOKMARK(6, "no_bookmark", 0),
+    BOOKMARK(6, "bookmark", 0),
 
-    DISALLOW_ADD_CONTACTS(7, "no_add_contacts", 0),
+    ADD_CONTACT(7, "add_contact", 0),
 
-    DISALLOW_SET_IMAGE(8, "no_set_image", 0),
+    SET_IMAGE(8, "set_image", 0),
 
     // UserManager.DISALLOW_MODIFY_ACCOUNTS
-    DISALLOW_MODIFY_ACCOUNTS(9, "no_modify_accounts", 0),
+    MODIFY_ACCOUNTS(9, "no_modify_accounts", 0),
 
-    DISALLOW_REMOTE_DEBUGGING(10, "no_remote_debugging", 0),
+    REMOTE_DEBUGGING(10, "remote_debugging", 0),
 
-    DISALLOW_IMPORT_SETTINGS(11, "no_import_settings", 0),
+    IMPORT_SETTINGS(11, "import_settings", 0),
 
-    DISALLOW_PRIVATE_BROWSING(12, "no_private_browsing", R.string.restriction_disallow_private_browsing_title),
+    PRIVATE_BROWSING(12, "private_browsing", R.string.restrictable_feature_private_browsing),
 
-    DISALLOW_LOCATION_SERVICE(13, "no_location_service", R.string.restriction_disallow_location_services_title),
+    LOCATION_SERVICE(13, "location_service", R.string.restrictable_feature_location_services),
 
-    DISALLOW_CLEAR_HISTORY(14, "no_clear_history", R.string.restriction_disallow_clear_history_title),
+    CLEAR_HISTORY(14, "clear_history", R.string.restrictable_feature_clear_history),
 
-    DISALLOW_MASTER_PASSWORD(15, "no_master_password", R.string.restriction_disallow_master_password_title),
+    MASTER_PASSWORD(15, "master_password", R.string.restrictable_feature_master_password),
 
-    DISALLOW_GUEST_BROWSING(16, "no_guest_browsing",  R.string.restriction_disallow_guest_browsing_title),
+    GUEST_BROWSING(16, "guest_browsing",  R.string.restrictable_feature_guest_browsing),
 
-    DISALLOW_ADVANCED_SETTINGS(17, "no_advanced_settings", R.string.restriction_disallow_advanced_settings_title),
+    ADVANCED_SETTINGS(17, "advanced_settings", R.string.restrictable_feature_advanced_settings),
 
-    DISALLOW_CAMERA_MICROPHONE(18, "no_camera_microphone", R.string.restriction_disallow_camera_microphone_title);
+    CAMERA_MICROPHONE(18, "camera_microphone", R.string.restrictable_feature_camera_microphone);
 
     public final int id;
     public final String name;
 
     @StringRes
     public final int title;
 
     Restrictable(final int id, final String name, @StringRes int title) {
--- a/mobile/android/base/restrictions/RestrictedProfileConfiguration.java
+++ b/mobile/android/base/restrictions/RestrictedProfileConfiguration.java
@@ -15,67 +15,73 @@ import android.os.Bundle;
 import android.os.StrictMode;
 import android.os.UserManager;
 
 import java.util.Arrays;
 import java.util.List;
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
 public class RestrictedProfileConfiguration implements RestrictionConfiguration {
-    static List<Restrictable> DEFAULT_RESTRICTIONS = Arrays.asList(
-            Restrictable.DISALLOW_INSTALL_EXTENSION,
-            Restrictable.DISALLOW_PRIVATE_BROWSING,
-            Restrictable.DISALLOW_LOCATION_SERVICE,
-            Restrictable.DISALLOW_CLEAR_HISTORY,
-            Restrictable.DISALLOW_MASTER_PASSWORD,
-            Restrictable.DISALLOW_GUEST_BROWSING,
-            Restrictable.DISALLOW_ADVANCED_SETTINGS,
-            Restrictable.DISALLOW_CAMERA_MICROPHONE
+    static List<Restrictable> DEFAULT_DISABLED_FEATURES = Arrays.asList(
+            Restrictable.INSTALL_EXTENSION,
+            Restrictable.PRIVATE_BROWSING,
+            Restrictable.LOCATION_SERVICE,
+            Restrictable.CLEAR_HISTORY,
+            Restrictable.MASTER_PASSWORD,
+            Restrictable.GUEST_BROWSING,
+            Restrictable.ADVANCED_SETTINGS,
+            Restrictable.CAMERA_MICROPHONE
     );
 
     private Context context;
-    private Bundle cachedRestrictions;
+    private Bundle cachedAppRestrictions;
+    private Bundle cachedUserRestrictions;
     private boolean isCacheInvalid = true;
 
     public RestrictedProfileConfiguration(Context context) {
         this.context = context.getApplicationContext();
     }
 
     @Override
     public synchronized boolean isAllowed(Restrictable restrictable) {
         if (isCacheInvalid || !ThreadUtils.isOnUiThread()) {
-            cachedRestrictions = readRestrictions();
+            readRestrictions();
             isCacheInvalid = false;
         }
 
-        return !cachedRestrictions.getBoolean(restrictable.name, DEFAULT_RESTRICTIONS.contains(restrictable));
+        // Special casing system/user restrictions
+        if (restrictable == Restrictable.INSTALL_APPS || restrictable == Restrictable.MODIFY_ACCOUNTS) {
+            return !cachedUserRestrictions.getBoolean(restrictable.name);
+        }
+
+        return cachedAppRestrictions.getBoolean(restrictable.name, !DEFAULT_DISABLED_FEATURES.contains(restrictable));
     }
 
-    private Bundle readRestrictions() {
+    private void readRestrictions() {
         final UserManager mgr = (UserManager) context.getSystemService(Context.USER_SERVICE);
 
         StrictMode.ThreadPolicy policy = StrictMode.allowThreadDiskReads();
 
         try {
-            Bundle restrictions = new Bundle();
-            restrictions.putAll(mgr.getApplicationRestrictions(context.getPackageName()));
-            restrictions.putAll(mgr.getUserRestrictions());
-            return restrictions;
+            cachedAppRestrictions = mgr.getApplicationRestrictions(context.getPackageName());
+            cachedUserRestrictions = mgr.getUserRestrictions();
+
+
         } finally {
             StrictMode.setThreadPolicy(policy);
         }
     }
 
     @Override
     public boolean canLoadUrl(String url) {
-        if (!isAllowed(Restrictable.DISALLOW_INSTALL_EXTENSION) && AboutPages.isAboutAddons(url)) {
+        if (!isAllowed(Restrictable.INSTALL_EXTENSION) && AboutPages.isAboutAddons(url)) {
             return false;
         }
 
-        if (!isAllowed(Restrictable.DISALLOW_PRIVATE_BROWSING) && AboutPages.isAboutPrivateBrowsing(url)) {
+        if (!isAllowed(Restrictable.PRIVATE_BROWSING) && AboutPages.isAboutPrivateBrowsing(url)) {
             return false;
         }
 
         if (AboutPages.isAboutConfig(url)) {
             // Always block access to about:config to prevent circumventing restrictions (Bug 1189233)
             return false;
         }
 
@@ -86,9 +92,9 @@ public class RestrictedProfileConfigurat
     public boolean isRestricted() {
         return true;
     }
 
     @Override
     public synchronized void update() {
         isCacheInvalid = true;
     }
-}
+}
\ No newline at end of file
--- a/mobile/android/base/restrictions/RestrictionProvider.java
+++ b/mobile/android/base/restrictions/RestrictionProvider.java
@@ -45,23 +45,23 @@ public class RestrictionProvider extends
                 result.finish();
             }
         }.start();
     }
 
     private ArrayList<RestrictionEntry> initRestrictions(Context context, Bundle oldRestrictions) {
         ArrayList<RestrictionEntry> entries = new ArrayList<RestrictionEntry>();
 
-        for (Restrictable restrictable : RestrictedProfileConfiguration.DEFAULT_RESTRICTIONS) {
-            if (restrictable == Restrictable.DISALLOW_LOCATION_SERVICE && !AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED) {
+        for (Restrictable restrictable : RestrictedProfileConfiguration.DEFAULT_DISABLED_FEATURES) {
+            if (restrictable == Restrictable.LOCATION_SERVICE && !AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED) {
                 continue;
             }
 
             RestrictionEntry entry = createRestrictionEntryWithDefaultValue(context, restrictable,
-                    oldRestrictions.getBoolean(restrictable.name, true));
+                    oldRestrictions.getBoolean(restrictable.name, false));
             entries.add(entry);
         }
 
         return entries;
     }
 
     private RestrictionEntry createRestrictionEntryWithDefaultValue(Context context, Restrictable restrictable, boolean defaultValue) {
         RestrictionEntry entry = new RestrictionEntry(restrictable.name, defaultValue);
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -559,25 +559,25 @@
   <string name="exit_guest_session_text">&exit_guest_session_text;</string>
 
   <string name="actionbar_menu">&actionbar_menu;</string>
   <string name="actionbar_done">&actionbar_done;</string>
 
   <!-- Voice search from the Awesome Bar -->
   <string name="voicesearch_prompt">&voicesearch_prompt;</string>
 
-  <!-- Restrictions -->
-  <string name="restriction_disallow_addons_title">&restriction_disallow_addons_title2;</string>
-  <string name="restriction_disallow_private_browsing_title">&restriction_disallow_private_browsing_title2;</string>
-  <string name="restriction_disallow_location_services_title">&restriction_disallow_location_services_title2;</string>
-  <string name="restriction_disallow_clear_history_title">&restriction_disallow_clear_history_title2;</string>
-  <string name="restriction_disallow_master_password_title">&restriction_disallow_master_password_title2;</string>
-  <string name="restriction_disallow_guest_browsing_title">&restriction_disallow_guest_browsing_title2;</string>
-  <string name="restriction_disallow_advanced_settings_title">&restriction_disallow_advanced_settings_title;</string>
-  <string name="restriction_disallow_camera_microphone_title">&restriction_disallow_camera_microphone_title;</string>
+  <!-- Restrictable features -->
+  <string name="restrictable_feature_addons_installation">&restrictable_feature_addons_installation;</string>
+  <string name="restrictable_feature_private_browsing">&restrictable_feature_private_browsing;</string>
+  <string name="restrictable_feature_location_services">&restrictable_feature_location_services;</string>
+  <string name="restrictable_feature_clear_history">&restrictable_feature_clear_history;</string>
+  <string name="restrictable_feature_guest_browsing">&restrictable_feature_guest_browsing;</string>
+  <string name="restrictable_feature_master_password">&restrictable_feature_master_password;</string>
+  <string name="restrictable_feature_advanced_settings">&restrictable_feature_advanced_settings;</string>
+  <string name="restrictable_feature_camera_microphone">&restrictable_feature_camera_microphone;</string>
 
   <!-- Miscellaneous -->
   <string name="ellipsis">&ellipsis;</string>
 
   <string name="colon">&colon;</string>
 
   <string name="percent">&percent;</string>
 
--- a/mobile/android/base/tabs/TabsPanel.java
+++ b/mobile/android/base/tabs/TabsPanel.java
@@ -139,17 +139,17 @@ public class TabsPanel extends LinearLay
 
         mTabWidget = (IconTabWidget) findViewById(R.id.tab_widget);
 
         mTabWidget.addTab(R.drawable.tabs_normal, R.string.tabs_normal);
         final ThemedImageButton privateTabsPanel =
                 (ThemedImageButton) mTabWidget.addTab(R.drawable.tabs_private, R.string.tabs_private);
         privateTabsPanel.setPrivateMode(true);
 
-        if (!Restrictions.isAllowed(mContext, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
+        if (!Restrictions.isAllowed(mContext, Restrictable.PRIVATE_BROWSING)) {
             mTabWidget.setVisibility(View.GONE);
         }
 
         mTabWidget.setTabSelectionListener(this);
 
         mMenuButton = findViewById(R.id.menu);
         mMenuButton.setOnClickListener(new Button.OnClickListener() {
             @Override
@@ -168,17 +168,17 @@ public class TabsPanel extends LinearLay
     }
 
     public void showMenu() {
         final Menu menu = mPopupMenu.getMenu();
 
         // Each panel has a "+" shortcut button, so don't show it for that panel.
         menu.findItem(R.id.new_tab).setVisible(mCurrentPanel != Panel.NORMAL_TABS);
         menu.findItem(R.id.new_private_tab).setVisible(mCurrentPanel != Panel.PRIVATE_TABS
-                && Restrictions.isAllowed(mContext, Restrictable.DISALLOW_PRIVATE_BROWSING));
+                && Restrictions.isAllowed(mContext, Restrictable.PRIVATE_BROWSING));
 
         // Only show "Clear * tabs" for current panel.
         menu.findItem(R.id.close_all_tabs).setVisible(mCurrentPanel == Panel.NORMAL_TABS);
         menu.findItem(R.id.close_private_tabs).setVisible(mCurrentPanel == Panel.PRIVATE_TABS);
 
         mPopupMenu.show();
     }
 
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4482,18 +4482,18 @@ Tab.prototype = {
 
     this._hostChanged = true;
 
     let fixedURI = aLocationURI;
     try {
       fixedURI = URIFixup.createExposableURI(aLocationURI);
     } catch (ex) { }
 
-    // In restricted profiles, we refuse to let you open any file urls.
-    if (!ParentalControls.isAllowed(ParentalControls.VISIT_FILE_URLS, fixedURI)) {
+    // In restricted profiles, we refuse to let you open various urls.
+    if (!ParentalControls.isAllowed(ParentalControls.BROWSE, fixedURI)) {
       aRequest.cancel(Cr.NS_BINDING_ABORTED);
 
       this.browser.docShell.displayLoadError(Cr.NS_ERROR_UNKNOWN_PROTOCOL, fixedURI, null);
     }
 
     let contentType = contentWin.document.contentType;
 
     // If fixedURI matches browser.lastURI, we assume this isn't a real location
--- a/mobile/android/tests/browser/chrome/test_restricted_profiles.html
+++ b/mobile/android/tests/browser/chrome/test_restricted_profiles.html
@@ -27,17 +27,17 @@ Migrated from Robocop: https://bugzilla.
     // In an admin profile, like the tests: enabled = false
     // In a restricted profile: enabled = true
     ok(!pc.parentalControlsEnabled);
     ok(!pc.blockFileDownloadsEnabled);
 
     ok(pc.isAllowed(Ci.nsIParentalControlsService.DOWNLOAD));
     ok(pc.isAllowed(Ci.nsIParentalControlsService.INSTALL_EXTENSION));
     ok(pc.isAllowed(Ci.nsIParentalControlsService.INSTALL_APP));
-    ok(pc.isAllowed(Ci.nsIParentalControlsService.VISIT_FILE_URLS));
+    ok(pc.isAllowed(Ci.nsIParentalControlsService.BROWSE));
     ok(pc.isAllowed(Ci.nsIParentalControlsService.SHARE));
     ok(pc.isAllowed(Ci.nsIParentalControlsService.BOOKMARK));
     ok(pc.isAllowed(Ci.nsIParentalControlsService.INSTALL_EXTENSION));
     ok(pc.isAllowed(Ci.nsIParentalControlsService.MODIFY_ACCOUNTS));
   }
 
   test_isUserRestricted();
 
--- a/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
+++ b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl
@@ -6,26 +6,26 @@
 
 #include "nsISupports.idl"
 
 interface nsIURI;
 interface nsIFile;
 interface nsIInterfaceRequestor;
 interface nsIArray;
 
-[scriptable, uuid(c7713ad7-0804-4353-91d5-4d7f1376bded)]
+[scriptable, uuid(ec6ae96e-e161-481e-bb51-78b11fc1fdbe)]
 interface nsIParentalControlsService : nsISupports
 {
   /**
    * Action types that can be blocked for users.
    */
   const short DOWNLOAD = 1; // Downloading files
   const short INSTALL_EXTENSION = 2; // Installing extensions
   const short INSTALL_APP = 3; // Installing webapps
-  const short VISIT_FILE_URLS = 4; // Opening file:/// urls
+  const short BROWSE = 4; // Opening specific urls
   const short SHARE = 5; // Sharing
   const short BOOKMARK = 6; // Creating bookmarks
   const short ADD_CONTACT = 7; // Add contacts to the system database
   const short SET_IMAGE = 8; // Setting images as wall paper
   const short MODIFY_ACCOUNTS = 9; // Modifying system accounts
   const short REMOTE_DEBUGGING = 10; // Remote debugging
   const short IMPORT_SETTINGS = 11; // Importing settings from other apps
   const short PRIVATE_BROWSING = 12; // Disallow usage of private browsing