Commit e962b11c authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

Bug 40925: Implemented the Security Level component

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.

Bug 40125: Expose Security Level pref in GeckoView
parent 18c1eebc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -236,6 +236,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",
@@ -1705,6 +1710,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
@@ -2474,6 +2482,8 @@ var gBrowserInit = {

    DownloadsButton.uninit();

    SecurityLevelButton.uninit();

    if (gToolbarKeyNavEnabled) {
      ToolbarKeyboardNavigator.uninit();
    }
+2 −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"?>
+1 −0
Original line number Diff line number Diff line
@@ -527,6 +527,7 @@
#include ../../components/downloads/content/downloadsPanel.inc.xhtml
#include ../../components/translations/content/translationsPanel.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
@@ -442,6 +442,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"
                     delegatesanchor="true"
+4 −0
Original line number Diff line number Diff line
@@ -60,6 +60,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
  Sanitizer: "resource:///modules/Sanitizer.sys.mjs",
  ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
  SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
  SecurityLevelRestartNotification:
    "resource:///modules/SecurityLevelRestartNotification.sys.mjs",
  SessionStartup: "resource:///modules/sessionstore/SessionStartup.sys.mjs",
  SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
  ShellService: "resource:///modules/ShellService.sys.mjs",
@@ -1814,6 +1816,8 @@ BrowserGlue.prototype = {

    lazy.DoHController.init();

    lazy.SecurityLevelRestartNotification.ready();

    ClipboardPrivacy.startup();

    this._firstWindowTelemetry(aWindow);
Loading