[tor-commits] [torbutton/master] Bug 31747: Move new identity and new circuit icons to browser repo

gk at torproject.org gk at torproject.org
Wed Oct 9 07:14:46 UTC 2019


commit 3509fb9c4e9db216066a0d102f37d9e3d1434ef0
Author: Alex Catarineu <acat at torproject.org>
Date:   Fri Oct 4 19:12:49 2019 +0200

    Bug 31747: Move new identity and new circuit icons to browser repo
---
 chrome/content/torbutton.js | 54 ---------------------------------------------
 chrome/skin/new_circuit.svg |  8 -------
 chrome/skin/torbutton.css   | 10 +--------
 3 files changed, 1 insertion(+), 71 deletions(-)

diff --git a/chrome/content/torbutton.js b/chrome/content/torbutton.js
index 907e4278..79f9843b 100644
--- a/chrome/content/torbutton.js
+++ b/chrome/content/torbutton.js
@@ -345,60 +345,6 @@ function torbutton_init() {
     torbutton_log(1, "registering Tor check observer");
     torbutton_tor_check_observer.register();
 
-    // Add torbutton and security level buttons to the bar.
-    // This should maybe be in the startup function, but we want to add
-    // the button to the panel before it's state (color) is set..
-    let insertedButton = m_tb_prefs.getBoolPref("extensions.torbutton.inserted_button");
-    let insertedSecurityLevel = m_tb_prefs.getBoolPref("extensions.torbutton.inserted_security_level");
-    if (!insertedButton || !insertedSecurityLevel) {
-      try {
-        // ESR31-style toolbar is handled by the existing compiled-in pref.
-        // We also need to prevent first-run toolbar reorg (#13378), so we
-        // reset this toolbar state on first-run.
-        try {
-          // get serialized toolbar state
-          let uiCustomizationStateJSON = m_tb_prefs.getStringPref("browser.uiCustomization.state");
-          let uiCustomizationState = JSON.parse(uiCustomizationStateJSON);
-
-          let placeButtonAfterUrlbar = function(navBar, buttonId) {
-            torbutton_log(3, 'placing ' + buttonId);
-            // try and remove button if it's present
-            let buttonIndex = navBar.indexOf(buttonId);
-            if (buttonIndex != -1) {
-              navBar.splice(buttonIndex, 1);
-            }
-            // if urlbar isn't present (which *shouldn't* be possible),
-            // inserts button at the beginning of the toolbar (since urlbarIndex will be -1)
-            let urlbarIndex = navBar.indexOf("urlbar-container");
-            buttonIndex = urlbarIndex + 1;
-            navBar.splice(buttonIndex, 0, buttonId);
-          };
-
-          // array of navbar elements
-          let navBar = uiCustomizationState["placements"]["nav-bar"];
-          placeButtonAfterUrlbar(navBar, "security-level-button");
-          placeButtonAfterUrlbar(navBar, "torbutton-button");
-
-          // serialize back into pref
-          uiCustomizationStateJSON = JSON.stringify(uiCustomizationState, null, 0);
-          m_tb_prefs.setStringPref("browser.uiCustomization.state", uiCustomizationStateJSON);
-        } catch(e) {
-          torbutton_log(4, 'error updating toolbar, reverting to default : ' + e);
-          // reverts the serialized toolbar state to default set in Tor Browser
-          m_tb_prefs.clearUserPref("browser.uiCustomization.state");
-        }
-        // reverts toolbar state to firefox defaults
-        CustomizableUI.reset();
-        // 'restores' toolbar state from serialized state in "browser.uiCustomization.state"
-        CustomizableUI.undoReset();
-        torbutton_log(3, 'toolbar updated');
-        m_tb_prefs.setBoolPref("extensions.torbutton.inserted_button", true);
-        m_tb_prefs.setBoolPref("extensions.torbutton.inserted_security_level", true);
-      } catch(e) {
-        torbutton_log(4, 'failed to update the toolbar : ' + e);
-      }
-    }
-
     torbutton_update_toolbutton();
     torbutton_notify_if_update_needed();
 
diff --git a/chrome/skin/new_circuit.svg b/chrome/skin/new_circuit.svg
deleted file mode 100644
index e0a93cc8..00000000
--- a/chrome/skin/new_circuit.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <title>Icon / New Circuit at 1.5x</title>
-    <g id="Icon-/-New-Circuit" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <path d="M13.4411138,10.1446317 L9.5375349,10.1446317 C8.99786512,10.1446317 8.56164018,10.5818326 8.56164018,11.1205264 C8.56164018,11.6592203 8.99786512,12.0964212 9.5375349,12.0964212 L11.4571198,12.0964212 C10.7554515,13.0479185 9.73466563,13.692009 8.60067597,13.9359827 C8.41818366,13.9720908 8.23276366,14.0033194 8.04734366,14.0218614 C7.97219977,14.0277168 7.89803177,14.0306445 7.82288788,14.0335722 C6.07506044,14.137017 4.290149,13.4499871 3.38647049,11.857327 C2.52280367,10.3349312 2.77263271,8.15966189 3.93687511,6.87343267 C5.12453898,5.56183017 7.44814431,5.04363008 8.21226987,3.38558497 C9.01738301,4.92847451 9.60682342,5.02801577 10.853041,6.15029468 C11.2892659,6.54455615 11.9704404,7.55558307 12.1861132,8.10501179 C12.3051723,8.40949094 12.5013272,9.17947187 12.5013272,9.17947187 L14.2862386,9.17947187 C14.2091429,7.59754654 13.439162,5.96877827 12.2261248,4.93628166 C11.279507,4.13116853 10.5065984,3.84718317 9.77662911,2.8088312 C9.63219669,2.60194152 9.599
 99216,2.4565332 9.56290816,2.21646311 C9.53851079,2.00762164 9.54143848,1.78511764 9.62048595,1.53919218 C9.65952174,1.41720534 9.59804037,1.28545955 9.47702943,1.23764071 L6.40296106,0.0167964277 C6.32391359,-0.0134563083 6.23413128,-0.00272146652 6.16679454,0.0480250584 L5.95502539,0.206120002 C5.85743592,0.280288 5.82815908,0.416913259 5.89159223,0.523285783 C6.70060895,1.92564648 6.36978064,2.82542141 5.8984235,3.20211676 C5.4914754,3.4900057 4.99084141,3.72226864 4.63366394,3.95453159 C3.82367132,4.47956294 3.03222071,5.02508808 2.40374451,5.76774396 C0.434388969,8.09427695 0.519291809,12.0046871 2.77165682,14.1077402 C3.65288975,14.9284676 4.70295247,15.4749686 5.81742423,15.7570022 C5.81742423,15.7570022 6.13556591,15.833122 6.21754107,15.8497122 C7.36616915,16.0829511 8.53529102,16.0146384 9.62243774,15.6672199 C9.67416016,15.6525815 9.77174963,15.620377 9.76784605,15.6154975 C10.7730176,15.2700308 11.7049971,14.7010841 12.4652191,13.90573 L12.4652191,15.0241053 C12.4652191,
 15.5627992 12.901444,16 13.4411138,16 C13.9798077,16 14.4170085,15.5627992 14.4170085,15.0241053 L14.4170085,11.1205264 C14.4170085,10.5818326 13.9798077,10.1446317 13.4411138,10.1446317" id="Fill-3" fill="context-fill" fill-opacity="context-fill-opacity"></path>
-        <path d="M5.107,7.462 C4.405,8.078 4,8.946 4,9.839 C4,10.712 4.422,11.57 5.13,12.132 C5.724,12.607 6.627,12.898 7.642,12.949 L7.642,5.8 C7.39,6.029 7.103,6.227 6.791,6.387 C5.993,6.812 5.489,7.133 5.107,7.462" id="Fill-1" fill="context-fill" fill-opacity="context-fill-opacity"></path>
-    </g>
-</svg>
diff --git a/chrome/skin/torbutton.css b/chrome/skin/torbutton.css
index 638520f9..669e05e5 100644
--- a/chrome/skin/torbutton.css
+++ b/chrome/skin/torbutton.css
@@ -58,12 +58,4 @@ svg#tor-circuit circle.node-circle {
     stroke: #195021;
     stroke-width: 2px;
     fill: white;
-}
-
-#appMenuNewIdentity {
-    list-style-image: url("chrome://browser/skin/reload.svg");
-}
-
-#appMenuNewCircuit {
-    list-style-image: url("chrome://torbutton/skin/new_circuit.svg");
-}
+}
\ No newline at end of file



More information about the tor-commits mailing list