Bug 1540416 - Move toggling the report breakage button out of onContentBlockingEvent. r=ewright

Differential Revision: https://phabricator.services.mozilla.com/D27254

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Johann Hofmann 2019-04-15 20:34:12 +00:00
Родитель db813346c4
Коммит 84629fe030
2 изменённых файлов: 15 добавлений и 11 удалений

Просмотреть файл

@ -1016,6 +1016,19 @@ var ContentBlocking = {
}).catch(Cu.reportError);
},
toggleReportBreakageButton() {
// For release (due to the large volume) we only want to receive reports
// for breakage that is directly related to third party cookie blocking.
if (this.reportBreakageEnabled ||
(ThirdPartyCookies.reportBreakageEnabled &&
ThirdPartyCookies.activated &&
!TrackingProtection.activated)) {
this.reportBreakageButton.removeAttribute("hidden");
} else {
this.reportBreakageButton.setAttribute("hidden", "true");
}
},
showReportBreakageSubview() {
// Save this URI to make sure that the user really only submits the location
// they see in the report breakage dialog.
@ -1142,17 +1155,6 @@ var ContentBlocking = {
this.iconBox.toggleAttribute("active", anyBlocking);
this.iconBox.toggleAttribute("hasException", hasException);
// For release (due to the large volume) we only want to receive reports
// for breakage that is directly related to third party cookie blocking.
if (this.reportBreakageEnabled ||
(ThirdPartyCookies.reportBreakageEnabled &&
ThirdPartyCookies.activated &&
!TrackingProtection.activated)) {
this.reportBreakageButton.removeAttribute("hidden");
} else {
this.reportBreakageButton.setAttribute("hidden", "true");
}
if (hasException) {
this.iconBox.setAttribute("tooltiptext", this.strings.disabledTooltipText);
if (!this.hadShieldState && !isSimulated) {

Просмотреть файл

@ -790,6 +790,8 @@ var gIdentityHandler = {
// Update per-site permissions section.
this.updateSitePermissions();
ContentBlocking.toggleReportBreakageButton();
},
setURI(uri) {