Bug 1184312 - Remove the bad-content notification;r=ttaubert

This commit is contained in:
Brian Grinstead 2015-08-07 15:22:54 -07:00
parent b65accb826
commit 573f22ea39
22 changed files with 1 additions and 402 deletions

View File

@ -767,10 +767,6 @@ window[chromehidden~="toolbar"] toolbar:not(#nav-bar):not(#TabsToolbar):not(#pri
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#identity-request-notification");
}
#bad-content-notification {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#bad-content-notification");
}
#click-to-play-plugins-notification {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#click-to-play-plugins-notification");
}
@ -1333,16 +1329,6 @@ toolbarpaletteitem[place="palette"][hidden] {
display: none;
}
/* Tracking protection doorhanger */
.popup-notification-footer[popupid="bad-content"] {
display: none;
}
.popup-notification-footer[popupid="bad-content"][mixedblockdisabled],
.popup-notification-footer[popupid="bad-content"][trackingblockdisabled] {
display: block;
}
#login-fill-doorhanger:not([inDetailView]) > #login-fill-clickcapturer {
pointer-events: none;
}

View File

@ -6917,47 +6917,6 @@ var gIdentityHandler = {
// we receive a new security state. If the user opened the popup and looks
// at the provided information we don't want to suddenly change the panel
// contents.
// Show the doorhanger when:
// - mixed active content is blocked
// - mixed active content is loaded (detected but not blocked)
// - tracking content is blocked
// - tracking content is not blocked
if (state &
(nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT |
nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT |
nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT |
nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT)) {
this.showBadContentDoorhanger(state);
}
},
showBadContentDoorhanger : function(state) {
var currentNotification =
PopupNotifications.getNotification("bad-content",
gBrowser.selectedBrowser);
// Avoid showing the same notification (same state) repeatedly.
if (currentNotification && currentNotification.options.state == state)
return;
let options = {
/* keep doorhanger collapsed */
dismissed: true,
state: state
};
// default
let iconState = "bad-content-blocked-notification-icon";
if (state &
(Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT |
Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT)) {
iconState = "bad-content-unblocked-notification-icon";
}
PopupNotifications.show(gBrowser.selectedBrowser, "bad-content",
"", iconState, null, null, options);
},
/**

View File

@ -742,8 +742,6 @@
<image id="webapps-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="web-notifications-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="bad-content-blocked-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="bad-content-unblocked-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="webRTC-sharingDevices-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="webRTC-shareMicrophone-notification-icon" class="notification-anchor-icon" role="button"/>

View File

@ -2402,259 +2402,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
</implementation>
</binding>
<binding id="bad-content-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
<content>
<xul:hbox align="start">
<xul:image class="popup-notification-icon" xbl:inherits="popupid,mixedblockdisabled,trackingblockdisabled"/>
<xul:vbox>
<!-- header -->
<xul:vbox>
<xul:description anonid="badContentBlocked.title"
class="popup-notification-item-title" xbl:inherits="popupid">
</xul:description>
<xul:description class="popup-notification-item-message"
xbl:inherits="popupid">
&badContentBlocked.moreinfo;
</xul:description>
</xul:vbox>
<!-- mixed content -->
<xul:vbox anonid="mixedContent" hidden="true">
<xul:separator class="groove"/>
<xul:hbox align="start">
<xul:vbox>
<xul:description class="popup-notification-item-title"
xbl:inherits="popupid">
&mixedContentBlocked2.message;
</xul:description>
<xul:description class="popup-notification-item-message"
xbl:inherits="popupid,mixedblockdisabled">
&mixedContentBlocked2.moreinfo;
</xul:description>
<xul:label anonid="mixedContent.helplink"
class="text-link" href=""
value="&mixedContentBlocked2.learnMore;"/>
</xul:vbox>
<xul:button
type="menu" label="&mixedContentBlocked2.options;"
sizetopopup="none">
<xul:menupopup>
<xul:menuitem anonid="mixedContentAction.unblock"
hidden="true" label="&mixedContentBlocked2.unblock.label;"
accesskey="&mixedContentBlocked2.unblock.accesskey;"
oncommand="document.getBindingParent(this).disableMixedContentProtection();"/>
<xul:menuitem anonid="mixedContentAction.block"
hidden="true" label="&mixedContentBlocked2.block.label;"
accesskey="&mixedContentBlocked2.block.accesskey;"
oncommand="document.getBindingParent(this).enableMixedContentProtection();"/>
</xul:menupopup>
</xul:button>
</xul:hbox>
<xul:hbox class="popup-notification-footer" xbl:inherits="popupid,mixedblockdisabled">
<xul:description class="popup-notification-item-message popup-notification-item-message-critical" xbl:inherits="popupid">
&mixedContentBlocked2.disabled.message;
</xul:description>
</xul:hbox>
</xul:vbox>
<!-- tracking content -->
<xul:vbox anonid="trackingContent" hidden="true">
<xul:separator class="groove"/>
<xul:hbox align="start">
<xul:vbox>
<xul:description class="popup-notification-item-title"
xbl:inherits="popupid">
&trackingContentBlocked.message;
</xul:description>
<xul:description class="popup-notification-item-message"
xbl:inherits="popupid,trackingblockdisabled">
&trackingContentBlocked.moreinfo;
</xul:description>
<xul:label anonid="trackingContent.helplink"
class="text-link" href=""
value="&trackingContentBlocked.learnMore;"/>
</xul:vbox>
<xul:button
type="menu" label="&trackingContentBlocked.options;"
sizetopopup="none">
<xul:menupopup>
<xul:menuitem anonid="trackingContentAction.unblock"
hidden="true" label="&trackingContentBlocked.unblock2.label;"
accesskey="&trackingContentBlocked.unblock2.accesskey;"
oncommand="document.getBindingParent(this).disableTrackingContentProtection();"/>
<xul:menuitem anonid="trackingContentAction.block"
hidden="true" label="&trackingContentBlocked.block.label;"
accesskey="&trackingContentBlocked.block.accesskey;"
oncommand="document.getBindingParent(this).enableTrackingContentProtection();"/>
</xul:menupopup>
</xul:button>
</xul:hbox>
<xul:hbox class="popup-notification-footer" xbl:inherits="popupid,trackingblockdisabled">
<xul:description class="popup-notification-item-message popup-notification-item-message-critical" xbl:inherits="popupid">
&trackingContentBlocked.disabled.message;
</xul:description>
</xul:hbox>
</xul:vbox>
</xul:vbox>
<xul:vbox pack="start">
<xul:toolbarbutton anonid="closebutton"
class="messageCloseButton popup-notification-closebutton tabbable close-icon"
xbl:inherits="oncommand=closebuttoncommand"
tooltiptext="&closeNotification.tooltip;"/>
</xul:vbox>
</xul:hbox>
</content>
<resources>
<stylesheet src="chrome://global/skin/notification.css"/>
</resources>
<implementation>
<field name="_brandShortName">
document.getElementById("bundle_brand").getString("brandShortName")
</field>
<field name="_doorhangerTitle">
document.getAnonymousElementByAttribute(this, "anonid",
"badContentBlocked.title")
</field>
<field name="_mixedContent">
document.getAnonymousElementByAttribute(this, "anonid",
"mixedContent")
</field>
<field name="_mixedContentUnblock">
document.getAnonymousElementByAttribute(this, "anonid",
"mixedContentAction.unblock")
</field>
<field name="_mixedContentBlock">
document.getAnonymousElementByAttribute(this, "anonid",
"mixedContentAction.block");
</field>
<field name="_mixedContentHelpLink">
document.getAnonymousElementByAttribute(this, "anonid",
"mixedContent.helplink")
</field>
<property name="isMixedContentBlocked" readonly="true">
<getter><![CDATA[
return this.notification.options.state &
Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT;
]]></getter>
</property>
<field name="_trackingContent">
document.getAnonymousElementByAttribute(this, "anonid",
"trackingContent")
</field>
<field name="_trackingContentUnblock">
document.getAnonymousElementByAttribute(this, "anonid",
"trackingContentAction.unblock")
</field>
<field name="_trackingContentBlock">
document.getAnonymousElementByAttribute(this, "anonid",
"trackingContentAction.block");
</field>
<field name="_trackingContentHelpLink">
document.getAnonymousElementByAttribute(this, "anonid",
"trackingContent.helplink")
</field>
<property name="isTrackingContentBlocked" readonly="true">
<getter><![CDATA[
return !!(this.notification.options.state &
Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT);
]]></getter>
</property>
<constructor><![CDATA[
// default title
_doorhangerTitle.value =
gNavigatorBundle.getFormattedString(
"badContentBlocked.notblocked.message", [this._brandShortName]);
if (this.notification.options.state &
Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
_doorhangerTitle.value =
gNavigatorBundle.getFormattedString(
"badContentBlocked.blocked.message", [this._brandShortName]);
_mixedContent.hidden = false;
_mixedContentUnblock.hidden = false;
_mixedContentHelpLink.href =
Services.urlFormatter.formatURLPref("app.support.baseURL")
+ "mixed-content";
}
if (this.notification.options.state &
Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT) {
this.setAttribute("mixedblockdisabled", true);
_mixedContent.hidden = false;
_mixedContentBlock.hidden = false;
_mixedContentHelpLink.href =
Services.urlFormatter.formatURLPref("app.support.baseURL")
+ "mixed-content";
}
if (this.notification.options.state &
Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT) {
_doorhangerTitle.value =
gNavigatorBundle.getFormattedString(
"badContentBlocked.blocked.message", [this._brandShortName]);
_trackingContent.hidden = false;
_trackingContentUnblock.hidden = false;
_trackingContentHelpLink.href =
Services.urlFormatter.formatURLPref("app.support.baseURL")
+ "tracking-protection";
}
if (this.notification.options.state &
Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT) {
this.setAttribute("trackingblockdisabled", true);
_trackingContent.hidden = false;
_trackingContentBlock.hidden = false;
_trackingContentHelpLink.href =
Services.urlFormatter.formatURLPref("app.support.baseURL")
+ "tracking-protection";
}
]]></constructor>
<method name="disableMixedContentProtection">
<body><![CDATA[
// Use telemetry to measure how often unblocking happens
const kMIXED_CONTENT_UNBLOCK_EVENT = 2;
let histogram =
Services.telemetry.getHistogramById(
"MIXED_CONTENT_UNBLOCK_COUNTER");
histogram.add(kMIXED_CONTENT_UNBLOCK_EVENT);
// Reload the page with the content unblocked
BrowserReloadWithFlags(
nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT);
]]></body>
</method>
<method name="enableMixedContentProtection">
<body><![CDATA[
gBrowser.selectedBrowser.messageManager.sendAsyncMessage(
"MixedContent:ReenableProtection", {});
BrowserReload();
]]></body>
</method>
<method name="disableTrackingContentProtection">
<body><![CDATA[
// convert document URI into the format used by
// nsChannelClassifier::ShouldEnableTrackingProtection
// (any scheme turned into https is correct)
let normalizedUrl = Services.io.newURI(
"https://" + gBrowser.selectedBrowser.currentURI.hostPort,
null, null);
// Add the current host/port combination in the 'trackingprotection' consumer of
// the permission manager using a normalized URI. This effectively
// places this host/port combination on the tracking protection allowlist.
Services.perms.add(normalizedUrl,
"trackingprotection", Services.perms.ALLOW_ACTION);
BrowserReload();
]]></body>
</method>
<method name="enableTrackingContentProtection">
<body><![CDATA[
// Remove the current host/port combination from the 'trackingprotection' consumer
// of the permission manager. This effectively removes this host/port combination
// from the tracking protection allowlist.
let normalizedUrl = Services.io.newURI(
"https://" + gBrowser.selectedBrowser.currentURI.hostPort,
null, null);
Services.perms.remove(normalizedUrl,
"trackingprotection");
BrowserReload();
]]></body>
</method>
</implementation>
</binding>
<binding id="click-to-play-plugins-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
<content align="start" style="width: &pluginNotification.width;;">
<xul:vbox flex="1" align="stretch" class="popup-notification-main-box"

View File

@ -99,7 +99,7 @@
accesskey="&trackingProtection5.accesskey;"
label="&trackingProtection5.label;" />
<image id="trackingProtectionImage"
src="chrome://browser/skin/bad-content-blocked-16.png"/>
src="chrome://browser/skin/tracking-protection-16.svg"/>
</hbox>
<hbox align="center"
class="indent">

View File

@ -792,19 +792,6 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY getUserMedia.audioCapture.label "Audio from the tab will be shared.">
<!ENTITY getUserMedia.allWindowsShared.message "All visible windows on your screen will be shared.">
<!-- Bad Content Blocker Doorhanger Notification -->
<!ENTITY badContentBlocked.moreinfo "Most websites will work properly even if content is blocked.">
<!ENTITY mixedContentBlocked2.message "Insecure content">
<!ENTITY mixedContentBlocked2.moreinfo "Some unencrypted elements on this website have been blocked.">
<!ENTITY mixedContentBlocked2.learnMore "Learn More">
<!ENTITY mixedContentBlocked2.options "Options">
<!ENTITY mixedContentBlocked2.unblock.label "Disable protection for now">
<!ENTITY mixedContentBlocked2.unblock.accesskey "D">
<!ENTITY mixedContentBlocked2.block.label "Enable protection">
<!ENTITY mixedContentBlocked2.block.accesskey "E">
<!ENTITY mixedContentBlocked2.disabled.message "Protection is disabled">
<!ENTITY trackingProtection.title "Tracking Protection">
<!ENTITY trackingProtection.detectedBlocked3 "&brandShortName; is blocking parts of the page that may track your browsing.">
<!ENTITY trackingProtection.detectedNotBlocked3 "This site includes elements that may track your browsing. You have disabled protection.">

View File

@ -1745,7 +1745,6 @@ toolbarbutton.chevron > .toolbarbutton-icon {
%include ../shared/devtools/responsivedesign.inc.css
%include ../shared/devtools/commandline.inc.css
%include ../shared/plugin-doorhanger.inc.css
%include ../shared/badcontent-doorhanger.inc.css
%include ../shared/login-doorhanger.inc.css
%include downloads/indicator.css

View File

@ -66,11 +66,6 @@ browser.jar:
skin/classic/browser/menuPanel-help@2x.png
skin/classic/browser/menuPanel-small.png
skin/classic/browser/menuPanel-small@2x.png
skin/classic/browser/bad-content-blocked-16.png (../shared/bad-content-blocked-16.png)
skin/classic/browser/bad-content-blocked-16@2x.png (../shared/bad-content-blocked-16@2x.png)
skin/classic/browser/bad-content-blocked-64.png (../shared/bad-content-blocked-64.png)
skin/classic/browser/bad-content-unblocked-16.png (../shared/bad-content-unblocked-16.png)
skin/classic/browser/bad-content-unblocked-64.png (../shared/bad-content-unblocked-64.png)
skin/classic/browser/monitor.png
skin/classic/browser/monitor_16-10.png
skin/classic/browser/notification-16.png

View File

@ -3362,7 +3362,6 @@ notification[value="loop-sharing-notification"] .messageImage {
%include ../shared/devtools/responsivedesign.inc.css
%include ../shared/devtools/commandline.inc.css
%include ../shared/plugin-doorhanger.inc.css
%include ../shared/badcontent-doorhanger.inc.css
%include ../shared/login-doorhanger.inc.css
%include downloads/indicator.css

View File

@ -80,14 +80,6 @@ browser.jar:
skin/classic/browser/menuPanel-help@2x.png
skin/classic/browser/menuPanel-small.png
skin/classic/browser/menuPanel-small@2x.png
skin/classic/browser/bad-content-blocked-16.png (../shared/bad-content-blocked-16.png)
skin/classic/browser/bad-content-blocked-16@2x.png (../shared/bad-content-blocked-16@2x.png)
skin/classic/browser/bad-content-blocked-64.png (../shared/bad-content-blocked-64.png)
skin/classic/browser/bad-content-blocked-64@2x.png (../shared/bad-content-blocked-64@2x.png)
skin/classic/browser/bad-content-unblocked-16.png (../shared/bad-content-unblocked-16.png)
skin/classic/browser/bad-content-unblocked-16@2x.png (../shared/bad-content-unblocked-16@2x.png)
skin/classic/browser/bad-content-unblocked-64.png (../shared/bad-content-unblocked-64.png)
skin/classic/browser/bad-content-unblocked-64@2x.png (../shared/bad-content-unblocked-64@2x.png)
skin/classic/browser/panel-expander-closed.png
skin/classic/browser/panel-expander-closed@2x.png
skin/classic/browser/panel-expander-open.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -1,21 +0,0 @@
.popup-notification-item-title[popupid="bad-content"] {
font-weight: bold;
}
.popup-notification-item-message[popupid="bad-content"] {
width: 17em;
}
.popup-notification-item-message[popupid="bad-content"][mixedblockdisabled]:not(.popup-notification-item-message-critical),
.popup-notification-item-message[popupid="bad-content"][trackingblockdisabled]:not(.popup-notification-item-message-critical) {
color: GrayText;
}
.popup-notification-item-message-critical[popupid="bad-content"] {
color: #d74345;
font-style: italic;
}
.popup-notification-footer[popupid="bad-content"] {
padding-top: 1em;
}

View File

@ -70,15 +70,6 @@
list-style-image: url(chrome://global/skin/icons/webapps-64.png);
}
.popup-notification-icon[popupid="bad-content"] {
list-style-image: url(chrome://browser/skin/bad-content-blocked-64.png);
}
.popup-notification-icon[popupid="bad-content"][mixedblockdisabled],
.popup-notification-icon[popupid="bad-content"][trackingblockdisabled] {
list-style-image: url(chrome://browser/skin/bad-content-unblocked-64.png);
}
.popup-notification-icon[popupid="webRTC-sharingDevices"],
.popup-notification-icon[popupid="webRTC-shareDevices"] {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
@ -221,16 +212,6 @@
}
}
.bad-content-blocked-notification-icon,
#bad-content-blocked-notification-icon {
list-style-image: url(chrome://browser/skin/bad-content-blocked-16.png);
}
.bad-content-unblocked-notification-icon,
#bad-content-unblocked-notification-icon {
list-style-image: url(chrome://browser/skin/bad-content-unblocked-16.png);
}
.webRTC-shareDevices-notification-icon,
#webRTC-shareDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
@ -421,14 +402,6 @@
-moz-image-region: rect(0, 96px, 32px, 64px);
}
#bad-content-blocked-notification-icon {
list-style-image: url(chrome://browser/skin/bad-content-blocked-16@2x.png);
}
#bad-content-unblocked-notification-icon {
list-style-image: url(chrome://browser/skin/bad-content-unblocked-16@2x.png);
}
.web-notifications-notification-icon,
#web-notifications-notification-icon {
list-style-image: url(chrome://browser/skin/notification-16@2x.png);
@ -463,15 +436,6 @@
list-style-image: url(chrome://browser/skin/notification-64@2x.png);
}
.popup-notification-icon[popupid="bad-content"] {
list-style-image: url(chrome://browser/skin/bad-content-blocked-64@2x.png);
}
.popup-notification-icon[popupid="bad-content"][mixedblockdisabled],
.popup-notification-icon[popupid="bad-content"][trackingblockdisabled] {
list-style-image: url(chrome://browser/skin/bad-content-unblocked-64@2x.png);
}
.popup-notification-icon[popupid="pointerLock"] {
list-style-image: url(chrome://browser/skin/pointerLock-64@2x.png);
}

View File

@ -2589,7 +2589,6 @@ notification[value="loop-sharing-notification"] .messageImage {
%include ../shared/devtools/responsivedesign.inc.css
%include ../shared/devtools/commandline.inc.css
%include ../shared/plugin-doorhanger.inc.css
%include ../shared/badcontent-doorhanger.inc.css
%include ../shared/login-doorhanger.inc.css
%include downloads/indicator.css

View File

@ -81,11 +81,6 @@ browser.jar:
skin/classic/browser/menuPanel-small@2x.png
skin/classic/browser/menuPanel-small-aero.png
skin/classic/browser/menuPanel-small-aero@2x.png
skin/classic/browser/bad-content-blocked-16.png (../shared/bad-content-blocked-16.png)
skin/classic/browser/bad-content-blocked-16@2x.png (../shared/bad-content-blocked-16@2x.png)
skin/classic/browser/bad-content-blocked-64.png (../shared/bad-content-blocked-64.png)
skin/classic/browser/bad-content-unblocked-16.png (../shared/bad-content-unblocked-16.png)
skin/classic/browser/bad-content-unblocked-64.png (../shared/bad-content-unblocked-64.png)
skin/classic/browser/monitor.png
skin/classic/browser/monitor_16-10.png
skin/classic/browser/notification-16.png