diff options
author | Gaming4JC <g4jc@bulletmail.org> | 2019-03-18 20:51:28 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@bulletmail.org> | 2019-03-18 20:51:28 -0400 |
commit | 1f5194b5f1deb0f36b36ed886d94ce5f8b62ca9d (patch) | |
tree | 0b09fca9ed0c1bfe73346ae1ac1a3ac68210d614 /application/basilisk/components/preferences/in-content/containers.js | |
parent | d0b4eb41bb6ac08171c164187bf33e03c58d4749 (diff) | |
download | UXP-1f5194b5f1deb0f36b36ed886d94ce5f8b62ca9d.tar UXP-1f5194b5f1deb0f36b36ed886d94ce5f8b62ca9d.tar.gz UXP-1f5194b5f1deb0f36b36ed886d94ce5f8b62ca9d.tar.lz UXP-1f5194b5f1deb0f36b36ed886d94ce5f8b62ca9d.tar.xz UXP-1f5194b5f1deb0f36b36ed886d94ce5f8b62ca9d.zip |
Issue #756 - Remove Contextual Identity from Basilisk
Diffstat (limited to 'application/basilisk/components/preferences/in-content/containers.js')
-rw-r--r-- | application/basilisk/components/preferences/in-content/containers.js | 73 |
1 files changed, 0 insertions, 73 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); - } - -}; |