Bug 1431274 - Move the "Allow Firefox to install and run studies" checkbox to the below of the "Allow Nightly to send technical and interaction data to Mozilla" checkbox to match spec.
MozReview-Commit-ID: S3vrVmtILl
--- a/browser/extensions/shield-recipe-client/lib/ShieldPreferences.jsm
+++ b/browser/extensions/shield-recipe-client/lib/ShieldPreferences.jsm
@@ -104,17 +104,18 @@ this.ShieldPreferences = {
hContainer.setAttribute("align", "center");
container.appendChild(hContainer);
const checkbox = doc.createElementNS(XUL_NS, "checkbox");
checkbox.setAttribute("id", "optOutStudiesEnabled");
checkbox.setAttribute("class", "tail-with-learn-more");
checkbox.setAttribute("label", "Allow Firefox to install and run studies");
checkbox.setAttribute("preference", OPT_OUT_STUDIES_ENABLED_PREF);
- checkbox.setAttribute("disabled", !Services.prefs.getBoolPref(FHR_UPLOAD_ENABLED_PREF));
+ checkbox.setAttribute("disabled", Services.prefs.prefIsLocked(FHR_UPLOAD_ENABLED_PREF) ||
+ !AppConstants.MOZ_TELEMETRY_REPORTING);
hContainer.appendChild(checkbox);
const viewStudies = doc.createElementNS(XUL_NS, "label");
viewStudies.setAttribute("id", "viewShieldStudies");
viewStudies.setAttribute("href", "about:studies");
viewStudies.setAttribute("useoriginprincipal", true);
viewStudies.textContent = "View Firefox Studies";
viewStudies.classList.add("learnMore", "text-link");
@@ -132,12 +133,12 @@ this.ShieldPreferences = {
const fhrPref = doc.defaultView.Preferences.add({ id: FHR_UPLOAD_ENABLED_PREF, type: "bool" });
fhrPref.on("change", function(event) {
// Avoid reference to the document directly, to avoid leaks.
const eventTargetCheckbox = event.target.ownerDocument.getElementById("optOutStudiesEnabled");
eventTargetCheckbox.disabled = !Services.prefs.getBoolPref(FHR_UPLOAD_ENABLED_PREF);
});
// Actually inject the elements we've created.
- const parent = doc.getElementById("submitHealthReportBox").closest("vbox");
+ const parent = doc.getElementById("submitHealthReportBox").closest("description");
parent.appendChild(container);
},
};