Unverified Commit 983968e1 authored by Richard Pospesel's avatar Richard Pospesel Committed by Matthew Finkel
Browse files

Bug 25658: Replace security slider with security level UI

This patch adds a new 'securitylevel' component to Tor Browser intended
to replace the torbutton 'Security Slider'.

This component adds a new Security Level toolbar button which visually
indicates the current global security level via icon (as defined by the
extensions.torbutton.security_slider pref), a drop-down hanger with a
short description of the current security level, and a new section in
the about:preferences#privacy page where users can change their current
security level. In addition, the hanger and the preferences page will
show a visual warning when the user has modified prefs associated with
the security level and provide a one-click 'Restore Defaults' button to
get the user back on recommended settings.

Strings used by this patch are pulled from the torbutton extension, but
en-US defaults are provided if there is an error loading from the
extension. With this patch applied, the usual work-flow of "./mach build
&& ./mach run" work as expected, even if the torbutton extension is
disabled.
parent 8bbaf487
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -216,6 +216,11 @@ XPCOMUtils.defineLazyScriptGetter(
  ["DownloadsButton", "DownloadsIndicatorView"],
  "chrome://browser/content/downloads/indicator.js"
);
XPCOMUtils.defineLazyScriptGetter(
  this,
  ["SecurityLevelButton"],
  "chrome://browser/content/securitylevel/securityLevel.js"
);
XPCOMUtils.defineLazyScriptGetter(
  this,
  "gEditItemOverlay",
@@ -1876,6 +1881,9 @@ var gBrowserInit = {
    // doesn't flicker as the window is being shown.
    DownloadsButton.init();

    // Init the SecuritySettingsButton
    SecurityLevelButton.init();

    // Certain kinds of automigration rely on this notification to complete
    // their tasks BEFORE the browser window is shown. SessionStore uses it to
    // restore tabs into windows AFTER important parts like gMultiProcessBrowser
@@ -2558,6 +2566,8 @@ var gBrowserInit = {

    DownloadsButton.uninit();

    SecurityLevelButton.uninit();

    gAccessibilityServiceIndicator.uninit();

    AccessibilityRefreshBlocker.uninit();
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/tabbrowser.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/downloads/downloads.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelPanel.css"?>
<?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelButton.css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
@@ -623,6 +625,7 @@
#include ../../components/controlcenter/content/protectionsPanel.inc.xhtml
#include ../../components/downloads/content/downloadsPanel.inc.xhtml
#include ../../../devtools/startup/enableDevToolsPopup.inc.xhtml
#include ../../components/securitylevel/content/securityLevelPanel.inc.xhtml
#include browser-allTabsMenu.inc.xhtml

    <hbox id="downloads-animation-container">
@@ -1136,6 +1139,8 @@
            </stack>
          </toolbarbutton>

#include ../../components/securitylevel/content/securityLevelButton.inc.xhtml

        <toolbarbutton id="library-button" class="toolbarbutton-1 chromeclass-toolbar-additional subviewbutton-nav"
                       removable="true"
                       onmousedown="PanelUI.showSubView('appMenu-libraryView', this, event);"
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ DIRS += [
    'protocolhandler',
    'resistfingerprinting',
    'search',
    'securitylevel',
    'sessionstore',
    'shell',
    'ssb',
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
<?xml-stylesheet href="chrome://browser/skin/preferences/search.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/privacy.css"?>
<?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelPreferences.css"?>

<!DOCTYPE html>

+2 −0
Original line number Diff line number Diff line
@@ -913,6 +913,8 @@
  <html:h1 data-l10n-id="security-header"/>
</hbox>

#include ../securitylevel/content/securityLevelPreferences.inc.xhtml

<!-- addons, forgery (phishing) UI Security -->
<groupbox id="browsingProtectionGroup" data-category="panePrivacy" hidden="true">
  <label><html:h2 data-l10n-id="security-browsing-protection"/></label>
Loading