[tbb-commits] [tor-launcher/master] Bug 14122: Hide logo if TOR_HIDE_BROWSER_LOGO set.

gk at torproject.org gk at torproject.org
Tue Jan 13 09:23:37 UTC 2015


commit c1ee486489e33bb07164448b096afba5d899f661
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Mon Jan 12 17:39:45 2015 -0500

    Bug 14122: Hide logo if TOR_HIDE_BROWSER_LOGO set.
    
    If the TOR_HIDE_BROWSER_LOGO environment variable is set, hide
    Tor Browser logo within the network settings wizard. Based on
    contributions from linostar and proper.
---
 src/chrome/content/network-settings-wizard.xul |   12 ++++++------
 src/chrome/content/network-settings.js         |    9 ++++++++-
 src/chrome/skin/network-settings.css           |    7 ++++++-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/chrome/content/network-settings-wizard.xul b/src/chrome/content/network-settings-wizard.xul
index 04251f9..33ba6c5 100644
--- a/src/chrome/content/network-settings-wizard.xul
+++ b/src/chrome/content/network-settings-wizard.xul
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-   - Copyright (c) 2014, The Tor Project, Inc.
+   - Copyright (c) 2015, The Tor Project, Inc.
    - See LICENSE for licensing information.
    - vim: set sw=2 sts=2 ts=8 et syntax=xml:
   -->
@@ -35,7 +35,7 @@
       <vbox class="tbb-logo-box" align="start">
         <image class="tbb-logo" />
       </vbox>
-      <separator orient="vertical" />
+      <separator class="tbb-logo-separator" orient="vertical" />
       <groupbox flex="1">
         <description>&torsettings.prompt;</description>
       </groupbox>
@@ -60,7 +60,7 @@
     <vbox class="tbb-logo-box" align="start">
       <image class="tbb-logo" />
     </vbox>
-    <separator />
+    <separator class="tbb-logo-separator" />
     <hbox>
       <vbox flex="1">
         <label class="question">&torSettings.proxyQuestion;</label>
@@ -79,7 +79,7 @@
     <vbox class="tbb-logo-box" align="start">
       <image class="tbb-logo" />
     </vbox>
-    <separator />
+    <separator class="tbb-logo-separator" />
     <label class="instructions">&torSettings.enterProxy;</label>
     <groupbox id="proxySpecificSettings" />
   </wizardpage>
@@ -89,7 +89,7 @@
     <vbox class="tbb-logo-box" align="start">
       <image class="tbb-logo" />
     </vbox>
-    <separator />
+    <separator class="tbb-logo-separator" />
     <hbox>
       <vbox flex="1">
         <label class="question">&torSettings.bridgeQuestion;</label>
@@ -109,7 +109,7 @@
     <vbox class="tbb-logo-box" align="start">
       <image class="tbb-logo" />
     </vbox>
-    <separator />
+    <separator class="tbb-logo-separator" />
     <vbox>
       <label id="bridgeSettingsPrompt"
              class="question">&torSettings.bridgeSettingsPrompt;</label>
diff --git a/src/chrome/content/network-settings.js b/src/chrome/content/network-settings.js
index 908e711..f100f90 100644
--- a/src/chrome/content/network-settings.js
+++ b/src/chrome/content/network-settings.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2014, The Tor Project, Inc.
+// Copyright (c) 2015, The Tor Project, Inc.
 // See LICENSE for licensing information.
 //
 // vim: set sw=2 sts=2 ts=8 et syntax=javascript:
@@ -120,6 +120,13 @@ function initDialog()
   var haveWizard = (wizardElem != null);
   if (haveWizard)
   {
+    // Hide the Tor Browser logo and associated separator element if the
+    // TOR_HIDE_BROWSER_LOGO environment variable is set.
+    let env = Cc["@mozilla.org/process/environment;1"]
+                .getService(Ci.nsIEnvironment); 
+    if (env.exists("TOR_HIDE_BROWSER_LOGO"))
+      wizardElem.setAttribute("tor_hide_browser_logo", true);
+
     // Set "Copy Tor Log" label and move it after the Quit (cancel) button.
     var copyLogBtn = document.documentElement.getButton("extra2");
     if (copyLogBtn)
diff --git a/src/chrome/skin/network-settings.css b/src/chrome/skin/network-settings.css
index e4142d4..331ae42 100644
--- a/src/chrome/skin/network-settings.css
+++ b/src/chrome/skin/network-settings.css
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, The Tor Project, Inc.
+ * Copyright (c) 2015, The Tor Project, Inc.
  * See LICENSE for licensing information.
  *
  * vim: set sw=2 sts=2 ts=8 et syntax=css:
@@ -94,6 +94,11 @@ button.firstAnswer {
   margin-right: 20px;
 }
 
+wizard[tor_hide_browser_logo="true"] .tbb-logo,
+wizard[tor_hide_browser_logo="true"] .tbb-logo-separator {
+  display: none;
+}
+
 #bridgeCustomEntry {
   margin-left: 30px;
 }





More information about the tbb-commits mailing list