diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2019-03-25 18:03:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-25 18:03:03 +0100 |
commit | aa816b3d848d38c83204c3dd1a1d0b86013978b4 (patch) | |
tree | e96cabae4a274f8bf5a53c12a9b200fbf47d74f1 /application/basilisk/components/preferences/in-content | |
parent | 24b1f14e0264152242a260dbc7e48b62206d1b17 (diff) | |
parent | 1413b3d6fd7297014d35d862abc792dc30c1ec24 (diff) | |
download | UXP-aa816b3d848d38c83204c3dd1a1d0b86013978b4.tar UXP-aa816b3d848d38c83204c3dd1a1d0b86013978b4.tar.gz UXP-aa816b3d848d38c83204c3dd1a1d0b86013978b4.tar.lz UXP-aa816b3d848d38c83204c3dd1a1d0b86013978b4.tar.xz UXP-aa816b3d848d38c83204c3dd1a1d0b86013978b4.zip |
Merge pull request #834 from g4jc/remove_contextid
Issue #756 - Remove Contextual Identity
Diffstat (limited to 'application/basilisk/components/preferences/in-content')
7 files changed, 0 insertions, 253 deletions
diff --git a/application/basilisk/components/preferences/in-content/containers.js b/application/basilisk/components/preferences/in-content/containers.js deleted file mode 100644 index 758e45fff..000000000 --- a/application/basilisk/components/preferences/in-content/containers.js +++ /dev/null @@ -1,73 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -Components.utils.import("resource://gre/modules/AppConstants.jsm"); -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); - -const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties"); - -const defaultContainerIcon = "fingerprint"; -const defaultContainerColor = "blue"; - -let gContainersPane = { - - init() { - this._list = document.getElementById("containersView"); - - document.getElementById("backContainersLink").addEventListener("click", function () { - gotoPref("privacy"); - }); - - this._rebuildView(); - }, - - _rebuildView() { - const containers = ContextualIdentityService.getIdentities(); - while (this._list.firstChild) { - this._list.firstChild.remove(); - } - for (let container of containers) { - let item = document.createElement("richlistitem"); - item.setAttribute("containerName", ContextualIdentityService.getUserContextLabel(container.userContextId)); - item.setAttribute("containerIcon", container.icon); - item.setAttribute("containerColor", container.color); - item.setAttribute("userContextId", container.userContextId); - - this._list.appendChild(item); - } - }, - - onRemoveClick(button) { - let userContextId = button.getAttribute("value"); - ContextualIdentityService.remove(userContextId); - this._rebuildView(); - }, - onPeferenceClick(button) { - this.openPreferenceDialog(button.getAttribute("value")); - }, - - onAddButtonClick(button) { - this.openPreferenceDialog(null); - }, - - openPreferenceDialog(userContextId) { - let identity = { - name: "", - icon: defaultContainerIcon, - color: defaultContainerColor - }; - let title; - if (userContextId) { - identity = ContextualIdentityService.getIdentityFromId(userContextId); - // This is required to get the translation string from defaults - identity.name = ContextualIdentityService.getUserContextLabel(identity.userContextId); - title = containersBundle.formatStringFromName("containers.updateContainerTitle", [identity.name], 1); - } - - const params = { userContextId, identity, windowTitle: title }; - gSubDialog.open("chrome://browser/content/preferences/containers.xul", - null, params); - } - -}; diff --git a/application/basilisk/components/preferences/in-content/containers.xul b/application/basilisk/components/preferences/in-content/containers.xul deleted file mode 100644 index e83bac1c3..000000000 --- a/application/basilisk/components/preferences/in-content/containers.xul +++ /dev/null @@ -1,54 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -<!-- Containers panel --> - -<script type="application/javascript" - src="chrome://browser/content/preferences/in-content/containers.js"/> - -<preferences id="containerPreferences" hidden="true" data-category="paneContainer"> - <!-- Containers --> - <preference id="privacy.userContext.enabled" - name="privacy.userContext.enabled" - type="bool"/> - -</preferences> - -<hbox hidden="true" - class="container-header-links" - data-category="paneContainers"> - <label class="text-link" id="backContainersLink" value="&backLink.label;" /> -</hbox> - -<hbox id="header-containers" - class="header" - hidden="true" - data-category="paneContainers"> - <label class="header-name" flex="1">&paneContainers.title;</label> - <button class="help-button" - aria-label="&helpButton.label;"/> -</hbox> - -<!-- Containers --> -<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true"> - <vbox id="browserContainersbox"> - - <richlistbox id="containersView" orient="vertical" persist="lastSelectedType" - flex="1"> - <listheader equalsize="always"> - <treecol id="typeColumn" label="&label.label;" value="type" - persist="sortDirection" - flex="1" sortDirection="ascending"/> - <treecol id="actionColumn" value="action" - persist="sortDirection" - flex="1"/> - </listheader> - </richlistbox> - </vbox> - <vbox> - <hbox flex="1"> - <button onclick="gContainersPane.onAddButtonClick();" accesskey="&addButton.accesskey;" label="&addButton.label;"/> - </hbox> - </vbox> -</groupbox> diff --git a/application/basilisk/components/preferences/in-content/jar.mn b/application/basilisk/components/preferences/in-content/jar.mn index e61a88856..70544f332 100644 --- a/application/basilisk/components/preferences/in-content/jar.mn +++ b/application/basilisk/components/preferences/in-content/jar.mn @@ -9,7 +9,6 @@ browser.jar: content/browser/preferences/in-content/main.js * content/browser/preferences/in-content/privacy.js - content/browser/preferences/in-content/containers.js content/browser/preferences/in-content/advanced.js content/browser/preferences/in-content/applications.js * content/browser/preferences/in-content/content.js diff --git a/application/basilisk/components/preferences/in-content/preferences.js b/application/basilisk/components/preferences/in-content/preferences.js index e18ab4b04..35e10c58d 100644 --- a/application/basilisk/components/preferences/in-content/preferences.js +++ b/application/basilisk/components/preferences/in-content/preferences.js @@ -61,7 +61,6 @@ function init_all() { register_module("paneGeneral", gMainPane); register_module("paneSearch", gSearchPane); register_module("panePrivacy", gPrivacyPane); - register_module("paneContainers", gContainersPane); register_module("paneAdvanced", gAdvancedPane); register_module("paneApplications", gApplicationsPane); register_module("paneContent", gContentPane); diff --git a/application/basilisk/components/preferences/in-content/preferences.xul b/application/basilisk/components/preferences/in-content/preferences.xul index 7ec7ef119..093516140 100644 --- a/application/basilisk/components/preferences/in-content/preferences.xul +++ b/application/basilisk/components/preferences/in-content/preferences.xul @@ -13,7 +13,6 @@ href="chrome://browser/content/preferences/handlers.css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/search.css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/containers.css"?> <!DOCTYPE page [ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> @@ -27,8 +26,6 @@ <!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd"> <!ENTITY % securityDTD SYSTEM "chrome://browser/locale/preferences/security.dtd"> -<!ENTITY % containersDTD SYSTEM - "chrome://browser/locale/preferences/containers.dtd"> <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd"> <!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd"> <!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd"> @@ -46,7 +43,6 @@ %syncBrandDTD; %syncDTD; %securityDTD; -%containersDTD; %sanitizeDTD; %mainDTD; %aboutHomeDTD; @@ -134,12 +130,6 @@ <label class="category-name" flex="1">&panePrivacy.title;</label> </richlistitem> - <richlistitem id="category-containers" - class="category" - value="paneContainers" - helpTopic="prefs-containers" - hidden="true"/> - <richlistitem id="category-security" class="category" value="paneSecurity" @@ -183,7 +173,6 @@ #include main.xul #include search.xul #include privacy.xul -#include containers.xul #include advanced.xul #include applications.xul #include content.xul diff --git a/application/basilisk/components/preferences/in-content/privacy.js b/application/basilisk/components/preferences/in-content/privacy.js index eab606e36..a976fb4fa 100644 --- a/application/basilisk/components/preferences/in-content/privacy.js +++ b/application/basilisk/components/preferences/in-content/privacy.js @@ -5,8 +5,6 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/PluralForm.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); @@ -62,59 +60,6 @@ var gPrivacyPane = { }, /** - * Show the Containers UI depending on the privacy.userContext.ui.enabled pref. - */ - _initBrowserContainers: function () { - if (!Services.prefs.getBoolPref("privacy.userContext.ui.enabled")) { - return; - } - - let link = document.getElementById("browserContainersLearnMore"); - link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "containers"; - - document.getElementById("browserContainersbox").hidden = false; - - document.getElementById("browserContainersCheckbox").checked = - Services.prefs.getBoolPref("privacy.userContext.enabled"); - }, - - _checkBrowserContainers: function(event) { - let checkbox = document.getElementById("browserContainersCheckbox"); - if (checkbox.checked) { - Services.prefs.setBoolPref("privacy.userContext.enabled", true); - return; - } - - let count = ContextualIdentityService.countContainerTabs(); - if (count == 0) { - Services.prefs.setBoolPref("privacy.userContext.enabled", false); - return; - } - - let bundlePreferences = document.getElementById("bundlePreferences"); - - let title = bundlePreferences.getString("disableContainersAlertTitle"); - let message = PluralForm.get(count, bundlePreferences.getString("disableContainersMsg")) - .replace("#S", count) - let okButton = PluralForm.get(count, bundlePreferences.getString("disableContainersOkButton")) - .replace("#S", count) - let cancelButton = bundlePreferences.getString("disableContainersButton2"); - - let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) + - (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1); - - let rv = Services.prompt.confirmEx(window, title, message, buttonFlags, - okButton, cancelButton, null, null, {}); - if (rv == 0) { - ContextualIdentityService.closeAllContainerTabs(); - Services.prefs.setBoolPref("privacy.userContext.enabled", false); - return; - } - - checkbox.checked = true; - }, - - /** * Sets up the UI for the number of days of history to keep, and updates the * label of the "Clear Now..." button. */ @@ -136,7 +81,6 @@ var gPrivacyPane = { this._initTrackingProtectionPBM(); #endif this._initAutocomplete(); - this._initBrowserContainers(); setEventListener("privacy.sanitize.sanitizeOnShutdown", "change", gPrivacyPane._updateSanitizeSettingsButton); @@ -184,10 +128,6 @@ var gPrivacyPane = { setEventListener("changeBlockListPBM", "command", gPrivacyPane.showBlockLists); #endif - setEventListener("browserContainersCheckbox", "command", - gPrivacyPane._checkBrowserContainers); - setEventListener("browserContainersSettings", "command", - gPrivacyPane.showContainerSettings); }, #ifdef MOZ_SAFE_BROWSING @@ -489,13 +429,6 @@ var gPrivacyPane = { }, #endif - /** - * Displays container panel for customising and adding containers. - */ - showContainerSettings() { - gotoPref("containers"); - }, - #ifdef MOZ_SAFE_BROWSING /** * Displays the available block lists for tracking protection. @@ -702,25 +635,4 @@ var gPrivacyPane = { settingsButton.disabled = !sanitizeOnShutdownPref.value; }, - - // CONTAINERS - - /* - * preferences: - * - * privacy.userContext.enabled - * - true if containers is enabled - */ - - /** - * Enables/disables the Settings button used to configure containers - */ - readBrowserContainersCheckbox: function () - { - var pref = document.getElementById("privacy.userContext.enabled"); - var settings = document.getElementById("browserContainersSettings"); - - settings.disabled = !pref.value; - } - }; diff --git a/application/basilisk/components/preferences/in-content/privacy.xul b/application/basilisk/components/preferences/in-content/privacy.xul index e6cdc5dd2..691cd6bf9 100644 --- a/application/basilisk/components/preferences/in-content/privacy.xul +++ b/application/basilisk/components/preferences/in-content/privacy.xul @@ -302,28 +302,3 @@ &suggestionSettings.label; </label> </groupbox> - -<!-- Containers --> -<groupbox id="browserContainersGroup" data-category="panePrivacy" hidden="true"> - <vbox id="browserContainersbox" hidden="true"> - <caption><label>&browserContainersHeader.label; - <label id="browserContainersLearnMore" class="text-link" - value="&browserContainersLearnMore.label;"/> - </label></caption> - <hbox align="start"> - <vbox> - <checkbox id="browserContainersCheckbox" - label="&browserContainersEnabled.label;" - accesskey="&browserContainersEnabled.accesskey;" - preference="privacy.userContext.enabled" - onsyncfrompreference="return gPrivacyPane.readBrowserContainersCheckbox();"/> - </vbox> - <spacer flex="1"/> - <vbox> - <button id="browserContainersSettings" - label="&browserContainersSettings.label;" - accesskey="&browserContainersSettings.accesskey;"/> - </vbox> - </hbox> - </vbox> -</groupbox> |