[tbb-commits] [torbutton/master] Bug 11384: Completely remove hidden toggle menu item.

mikeperry at torproject.org mikeperry at torproject.org
Tue Apr 22 22:07:59 UTC 2014


commit 003daf4de85948eea53334db71a757a714b5873a
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Tue Apr 22 15:07:00 2014 -0700

    Bug 11384: Completely remove hidden toggle menu item.
---
 src/chrome/content/popup.xul        |    5 -----
 src/chrome/content/preferences.js   |    3 ---
 src/chrome/content/preferences.xul  |    3 ---
 src/chrome/content/torbutton.js     |   26 +-------------------------
 src/chrome/content/torbutton.xul    |   11 +----------
 src/chrome/content/torbutton_tb.xul |    9 ---------
 6 files changed, 2 insertions(+), 55 deletions(-)

diff --git a/src/chrome/content/popup.xul b/src/chrome/content/popup.xul
index cb4c780..3ee953b 100644
--- a/src/chrome/content/popup.xul
+++ b/src/chrome/content/popup.xul
@@ -16,11 +16,6 @@
                   accesskey="&torbutton.context_menu.new_identity_key;"
                   insertafter="context-stop"
                   oncommand="torbutton_new_identity()"/>
-        <menuitem id="torbutton-toggle"
-                  label="&torbutton.context_menu.toggle;"
-                  accesskey="&torbutton.context_menu.toggle.key;"
-                  insertafter="context-stop"
-                  oncommand="torbutton_toggle(true)"/>
         <menuitem  id="torbutton-cookie-protector"
                   label="&torbutton.context_menu.cookieProtections;"
                   accesskey="&torbutton.context_menu.cookieProtections.key;"
diff --git a/src/chrome/content/preferences.js b/src/chrome/content/preferences.js
index 7f23ddf..e1b2bf5 100644
--- a/src/chrome/content/preferences.js
+++ b/src/chrome/content/preferences.js
@@ -180,8 +180,6 @@ function torbutton_prefs_init(doc) {
         doc.getElementById('torbutton_settingsMethod').selectedItem = doc.getElementById('torbutton_transparentTor');
     }
 
-    doc.getElementById('torbutton_lockedMode').checked = o_torprefs.getBoolPref('locked_mode');
-    
     doc.getElementById('torbutton_blockDisk').checked = o_torprefs.getBoolPref('block_disk');
     doc.getElementById('torbutton_resistFingerprinting').checked = o_torprefs.getBoolPref('resist_fingerprinting');
     doc.getElementById('torbutton_blockPlugins').checked = o_torprefs.getBoolPref('no_tor_plugins');
@@ -270,7 +268,6 @@ function torbutton_prefs_save(doc) {
             o_customprefs.setIntPref('socks_version', 5); 
         }
     }
-    o_torprefs.setBoolPref('locked_mode', doc.getElementById('torbutton_lockedMode').checked);
 
     o_torprefs.setBoolPref('block_disk', doc.getElementById('torbutton_blockDisk').checked);
     o_torprefs.setBoolPref('resist_fingerprinting', doc.getElementById('torbutton_resistFingerprinting').checked);
diff --git a/src/chrome/content/preferences.xul b/src/chrome/content/preferences.xul
index ee09b8b..5198565 100644
--- a/src/chrome/content/preferences.xul
+++ b/src/chrome/content/preferences.xul
@@ -131,9 +131,6 @@
         </radiogroup>
        
         
-        <checkbox id="torbutton_lockedMode"
-        label="&torbutton.prefs.locked_mode;"/>
-
         <hbox>
          <spacer flex="1"/>
          <button id="torbutton_testSettings"
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 5642a4a..79b01ce 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -282,29 +282,7 @@ function torbutton_set_panel_style() {
 
 // Bug 1506 P0: Die toggle, die! 
 function torbutton_toggle(force) {
-    var o_toolbutton = false;
-
-    // Only toggle if lock mode is set if the user goes out of their way.
-    if(!force && m_tb_prefs.getBoolPref("extensions.torbutton.locked_mode")) {
-        return;
-    }
-
-    o_toolbutton = torbutton_get_toolbutton();
-
-    torbutton_log(3, 'called toggle()');
-    if (!m_tb_wasinited) {
-        torbutton_init();
-    }
-
-    if (torbutton_check_status()) {
-        // Close on toggle before actually changing proxy settings
-        // as additional safety precaution
-        torbutton_close_on_toggle(false, false);
-        torbutton_disable_tor();
-    } else {
-        torbutton_close_on_toggle(true, false);
-        torbutton_enable_tor(false);
-    }
+    torbutton_log(5, "Somehow we received a toggle request. Refusing to honor it. (force="+force+")");
 }
 
 // Bug 1506 P0: Die toggle, die!
@@ -2123,9 +2101,7 @@ function torbutton_close_on_toggle(mode, newnym) {
 function torbutton_check_protections()
 {
   var cookie_pref = m_tb_prefs.getBoolPref("extensions.torbutton.cookie_protections");
-  var locked_pref = m_tb_prefs.getBoolPref("extensions.torbutton.locked_mode")
   document.getElementById("torbutton-cookie-protector").disabled = !cookie_pref;
-  document.getElementById("torbutton-toggle").collapsed = locked_pref;
 
   if (!m_tb_control_pass || !m_tb_control_port)
     document.getElementById("torbutton-new-identity").disabled = true;
diff --git a/src/chrome/content/torbutton.xul b/src/chrome/content/torbutton.xul
index 88dca7c..9e10b09 100644
--- a/src/chrome/content/torbutton.xul
+++ b/src/chrome/content/torbutton.xul
@@ -38,16 +38,7 @@
             menu="torbutton-context-menu"
             context="torbutton-context-menu"/>
     </toolbarpalette>
-    <!--
-    <commandset id="mainCommandSet">
-        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle(false);"/>
-    </commandset>
-
-    <keyset id="mainKeyset">
-        <key id="torbutton-toggle-key" modifiers="control" key="2"
-             command="torbutton-toggle-cmd"/>
-    </keyset>
-    -->
+
     <statusbar id="status-bar">
         <statusbarpanel id="torbutton-panel"
             insertbefore="statusbar-updates"
diff --git a/src/chrome/content/torbutton_tb.xul b/src/chrome/content/torbutton_tb.xul
index 5142b2e..c240248 100644
--- a/src/chrome/content/torbutton_tb.xul
+++ b/src/chrome/content/torbutton_tb.xul
@@ -37,15 +37,6 @@
             oncommand="torbutton_toggle(false);" />
     </toolbarpalette>
 
-    <commandset id="mainCommandSet">
-        <command id="torbutton-toggle-cmd" oncommand="torbutton_toggle(false);"/>
-    </commandset>
-
-    <keyset id="mainKeyset">
-        <key id="torbutton-toggle-key" modifiers="control shift" key="T"
-             command="torbutton-toggle-cmd"/>
-    </keyset>
-
     <statusbar id="status-bar">
         <statusbarpanel id="torbutton-panel"
             insertbefore="statusbar-updates"



More information about the tbb-commits mailing list