Bug 1462470 - Part 5 - Show a preferences button in the Tracking Protection section of the identity popup. r=paolo
MozReview-Commit-ID: AAScIwDsLnQ
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -52,24 +52,30 @@
oncommand="gIdentityHandler.showSecuritySubView();"/>
</hbox>
<!-- Tracking Protection Section -->
<hbox id="tracking-protection-container"
class="identity-popup-section"
when-connection="not-secure secure secure-ev secure-cert-user-overridden file">
<vbox id="tracking-protection-content" flex="1">
- <label id="tracking-protection-label-on"
- class="identity-popup-headline"
- crop="end"
- value="&trackingProtection.on;" />
- <label id="tracking-protection-label-off"
- class="identity-popup-headline"
- crop="end"
- value="&trackingProtection.off;" />
+ <hbox class="identity-popup-preferences-button-container">
+ <label id="tracking-protection-label-on"
+ class="identity-popup-headline"
+ crop="end"
+ value="&trackingProtection.on;" />
+ <label id="tracking-protection-label-off"
+ class="identity-popup-headline"
+ crop="end"
+ value="&trackingProtection.off;" />
+ <toolbarbutton id="tracking-protection-preferences-button"
+ class="identity-popup-preferences-button subviewbutton"
+ tooltiptext="&trackingProtection.tooltip;"
+ oncommand="TrackingProtection.openPreferences('identityPopup-TP-preferencesButton');" />
+ </hbox>
<description id="tracking-blocked"
crop="end">&trackingProtection.detectedBlocked3;</description>
<description id="tracking-loaded"
crop="end">&trackingProtection.detectedNotBlocked4;</description>
<description id="tracking-not-detected"
crop="end">&trackingProtection.notDetected4;</description>
<description id="tracking-reload-required"
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -128,16 +128,33 @@
background-color: var(--arrowpanel-dimmed);
}
.identity-popup-expander:hover:active {
background-color: var(--arrowpanel-dimmed-further);
box-shadow: 0 1px 0 hsla(210,4%,10%,.05) inset;
}
+/* PREFERENCES BUTTON */
+
+.identity-popup-preferences-button-container {
+ display: flex;
+ justify-content: space-between;
+}
+
+.identity-popup-preferences-button {
+ list-style-image: url(chrome://browser/skin/settings.svg);
+ padding: 5px 8px !important;
+ margin-bottom: 2px !important;
+}
+
+.identity-popup-preferences-button > .toolbarbutton-text {
+ display: none;
+}
+
/* CONTENT */
.identity-popup-permission-label,
.identity-popup-permission-state-label,
.identity-popup-security-content > description,
#identity-popup-security-descriptions > description,
#identity-popup-securityView-body > description,
#identity-popup-permissions-content > description,
@@ -284,31 +301,37 @@ description#identity-popup-content-verif
}
/* TRACKING PROTECTION */
#tracking-protection-content {
background-image: url("chrome://browser/skin/controlcenter/tracking-protection.svg");
}
+/* Don't show the TP preferences button when TP is off since the main action already
+ * opens about:preferences in that case */
+#tracking-protection-content[enabled="false"][state] .identity-popup-preferences-button {
+ display: none;
+}
+
#tracking-protection-content[enabled="false"],
#tracking-protection-content[state="loaded-tracking-content"] {
background-image: url("chrome://browser/skin/controlcenter/tracking-protection-disabled.svg");
}
/* Show the "on" label by default, except when TP is disabled or there's a local exception. */
#tracking-protection-label-off,
-#tracking-protection-content[enabled="false"] > #tracking-protection-label-on,
-#tracking-protection-content[state="loaded-tracking-content"] > #tracking-protection-label-on {
+#tracking-protection-content[enabled="false"] #tracking-protection-label-on,
+#tracking-protection-content[state="loaded-tracking-content"] #tracking-protection-label-on {
display: none;
}
#tracking-protection-label-on,
-#tracking-protection-content[enabled="false"] > #tracking-protection-label-off,
-#tracking-protection-content[state="loaded-tracking-content"] > #tracking-protection-label-off {
+#tracking-protection-content[enabled="false"] #tracking-protection-label-off,
+#tracking-protection-content[state="loaded-tracking-content"] #tracking-protection-label-off {
display: -moz-box;
}
#tracking-protection-content > description {
display: none;
}
.tracking-protection-button {