Bug 354940 - Make background color in URL bar for https: more obvious; patch with on/off preference. r=stefanh, ui-r=Neil
authorrsx11m <rsx11m.pub@gmail.com>
Thu, 31 Oct 2013 16:12:43 -0500
changeset 16972 d5ca9f7b2beb527b7caea524f1f0e565d875ae98
parent 16971 4abeeaf9eb701f6887456c7e225c215599f2b948
child 16973 78bb119743cf13bd10ea7a44e07213bcb9f19658
push id1074
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:47:23 +0000
treeherdercomm-beta@6b791b5369ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstefanh, Neil
bugs354940
Bug 354940 - Make background color in URL bar for https: more obvious; patch with on/off preference. r=stefanh, ui-r=Neil CLOSED TREE
suite/browser/browser-prefs.js
suite/browser/nsBrowserStatusHandler.js
suite/themes/classic/mac/navigator/navigator.css
suite/themes/classic/navigator/navigator.css
--- a/suite/browser/browser-prefs.js
+++ b/suite/browser/browser-prefs.js
@@ -127,16 +127,17 @@ pref("browser.search.suggest.enabled", t
 // Smart Browsing prefs
 pref("keyword.enabled", true);
 // Override the default keyword.URL. Empty value means
 // "use the search service's default engine"
 pref("keyword.URL", "");
 
 pref("browser.urlbar.autocomplete.enabled", true);
 pref("browser.urlbar.formatting.enabled", true);
+pref("browser.urlbar.highlight.secure", true);
 pref("browser.urlbar.clickSelectsAll", true);
 // when clickSelectsAll=true, does it also apply when the click is past end of text?
 pref("browser.urlbar.clickAtEndSelects", true);
 
 pref("browser.urlbar.autoFill", false);
 pref("browser.urlbar.showPopup", true);
 pref("browser.urlbar.showSearch", true);
 // 0: Match anywhere (e.g., middle of words)
--- a/suite/browser/nsBrowserStatusHandler.js
+++ b/suite/browser/nsBrowserStatusHandler.js
@@ -356,37 +356,46 @@ nsBrowserStatusHandler.prototype =
 
   onSecurityChange : function(aWebProgress, aRequest, aState)
   {
     const wpl = Components.interfaces.nsIWebProgressListener;
     const wpl_security_bits = wpl.STATE_IS_SECURE |
                               wpl.STATE_IS_BROKEN |
                               wpl.STATE_IS_INSECURE;
 
+    var highlightSecure =
+      Services.prefs.getBoolPref("browser.urlbar.highlight.secure");
+
     /* aState is defined as a bitmask that may be extended in the future.
      * We filter out any unknown bits before testing for known values.
      */
     switch (aState & wpl_security_bits) {
       case wpl.STATE_IS_SECURE:
         const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
         var cert = getBrowser().securityUI.QueryInterface(nsISSLStatusProvider)
                                .SSLStatus.serverCert;
         var issuerName = cert.issuerOrganization ||
                          cert.issuerCommonName || cert.issuerName;
         this.securityButton.setAttribute("tooltiptext",
           gNavigatorBundle.getFormattedString("securityButtonTooltipSecure",
                                               [issuerName]));
         this.securityButton.setAttribute("level", "high");
-        this.urlBar.setAttribute("level", "high");
+        if (highlightSecure)
+          this.urlBar.setAttribute("level", "high");
+        else
+          this.urlBar.removeAttribute("level");
         break;
       case wpl.STATE_IS_BROKEN:
         this.securityButton.setAttribute("tooltiptext",
           gNavigatorBundle.getString("securityButtonTooltipMixedContent"));
         this.securityButton.setAttribute("level", "broken");
-        this.urlBar.setAttribute("level", "broken");
+        if (highlightSecure)
+          this.urlBar.setAttribute("level", "broken");
+        else
+          this.urlBar.removeAttribute("level");
         break;
       case wpl.STATE_IS_INSECURE:
       default:
         this.securityButton.setAttribute("tooltiptext",
           gNavigatorBundle.getString("securityButtonTooltipInsecure"));
         this.securityButton.removeAttribute("level");
         this.urlBar.removeAttribute("level");
         break;
--- a/suite/themes/classic/mac/navigator/navigator.css
+++ b/suite/themes/classic/mac/navigator/navigator.css
@@ -215,22 +215,22 @@ toolbar[mode="text"] > #window-controls 
   margin-top: -1px;
   margin-bottom: -2px;
   padding-top: 1px;
   padding-bottom: 1px;
 }
 
 #urlbar[level="high"] > .autocomplete-textbox-container {
   -moz-appearance: none;
-  background-color: InfoBackground;
-  color: InfoText;
+  background-color: #FFFFC7;
+  color: #000000;
 }
 
 #urlbar[level="high"] > .autocomplete-history-dropmarker {
-  background-color: InfoBackground !important;
+  background-color: #FFFFC7 !important;
 }
 
 #wrapper-nav-bar-inner[place="palette"] > #nav-bar-inner > .button-toolbar,
 #wrapper-nav-bar-inner[place="palette"] > #nav-bar-inner > #urlbar > .urlbar-icons {
   display: none;
 }
 
 /* ::::: notification popups ::::: */
--- a/suite/themes/classic/navigator/navigator.css
+++ b/suite/themes/classic/navigator/navigator.css
@@ -251,18 +251,18 @@ toolbar[mode="text"] > #window-controls 
 /* ::::: nav-bar-inner ::::: */
   
 .nav-bar-class {
   -moz-box-align: center;
   min-width: 0px;
 }
 
 .urlbar-security-level[level="high"] {
-  background-color: InfoBackground;
-  color: InfoText;
+  background-color: #FFFFC7;
+  color: #000000;
 }
 
 #wrapper-nav-bar-inner[place="palette"] > #nav-bar-inner
   > .button-toolbar,
 #wrapper-nav-bar-inner[place="palette"] > #nav-bar-inner
   > #urlbar > .urlbar-icons {
   display: none;
 }