Commit 9c472fd0 authored by Richard Pospesel's avatar Richard Pospesel
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 79f6bd71
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -224,6 +224,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",
@@ -1760,6 +1765,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
@@ -2493,6 +2501,8 @@ var gBrowserInit = {

    DownloadsButton.uninit();

    SecurityLevelButton.uninit();

    TorBootstrapUrlbar.uninit();

    gAccessibilityServiceIndicator.uninit();
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,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"?>
+1 −0
Original line number Diff line number Diff line
@@ -520,6 +520,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

  <tooltip id="dynamic-shortcut-tooltip"
+2 −0
Original line number Diff line number Diff line
@@ -413,6 +413,8 @@
        </box>
      </toolbarbutton>

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

      <toolbarbutton id="fxa-toolbar-menu-button" class="toolbarbutton-1 chromeclass-toolbar-additional subviewbutton-nav"
                     badged="true"
                     onmousedown="gSync.toggleAccountPanel(this, event)"
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ DIRS += [
    "protocolhandler",
    "resistfingerprinting",
    "search",
    "securitylevel",
    "sessionstore",
    "shell",
    "syncedtabs",
Loading