Bug 618437 - No indication of blocked popups when the notification bar is disabled. r=dao, a=blocking-beta9

--HG--
extra : rebase_source : c4d2225abba80313d7830ccc96a1f7d5315ff888
This commit is contained in:
Margaret Leibovic 2010-12-16 09:53:27 -08:00
parent cee522be13
commit 8de60c6392
10 changed files with 88 additions and 12 deletions

View File

@ -372,15 +372,35 @@ function findChildShell(aDocument, aDocShell, aSoughtURI) {
return null;
}
const gPopupBlockerObserver = {
var gPopupBlockerObserver = {
_reportButton: null,
onReportButtonClick: function (aEvent)
{
if (aEvent.button != 0 || aEvent.target != this._reportButton)
return;
onUpdatePageReport: function (aEvent)
document.getElementById("blockedPopupOptions")
.openPopup(this._reportButton, "after_end", 0, 2, false, false, aEvent);
},
handleEvent: function (aEvent)
{
if (aEvent.originalTarget != gBrowser.selectedBrowser)
return;
if (!gBrowser.pageReport)
if (!this._reportButton && gURLBar)
this._reportButton = document.getElementById("page-report-button");
if (!gBrowser.pageReport) {
// Hide the icon in the location bar (if the location bar exists)
if (gURLBar)
this._reportButton.hidden = true;
return;
}
if (gURLBar)
this._reportButton.hidden = false;
// Only show the notification again if we've not already shown it. Since
// notifications are per-browser, we don't need to worry about re-adding
@ -538,7 +558,16 @@ const gPopupBlockerObserver = {
var blockedPopupDontShowMessage = document.getElementById("blockedPopupDontShowMessage");
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
blockedPopupDontShowMessage.setAttribute("checked", !showMessage);
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
if (aEvent.target.anchorNode.id == "page-report-button") {
aEvent.target.anchorNode.setAttribute("open", "true");
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromLocationbar"));
} else
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
},
onPopupHiding: function (aEvent) {
if (aEvent.target.anchorNode.id == "page-report-button")
aEvent.target.anchorNode.removeAttribute("open");
},
showBlockedPopup: function (aEvent)
@ -1264,7 +1293,7 @@ function HandleAppCommandEvent(evt) {
}
function prepareForStartup() {
gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false);
gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver, false);
gBrowser.addEventListener("PluginNotFound", gPluginHandler, true);
gBrowser.addEventListener("PluginCrashed", gPluginHandler, true);

View File

@ -303,7 +303,8 @@
</menupopup>
<menupopup id="blockedPopupOptions"
onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
onpopupshowing="gPopupBlockerObserver.fillPopupList(event);"
onpopuphiding="gPopupBlockerObserver.onPopupHiding(event);">
<menuitem observes="blockedPopupAllowSite"/>
<menuitem observes="blockedPopupEditSettings"/>
<menuitem observes="blockedPopupDontShowMessage"/>
@ -566,6 +567,12 @@
</box>
<label id="urlbar-display" value="&urlbar.switchToTab.label;"/>
<hbox id="urlbar-icons">
<image id="page-report-button"
class="urlbar-icon"
hidden="true"
tooltiptext="&pageReportIcon.tooltip;"
onclick="gPopupBlockerObserver.onReportButtonClick(event);"/>
<image id="star-button"
class="urlbar-icon"
hidden="true"

View File

@ -93,6 +93,7 @@ popupWarningButtonUnix.accesskey=P
popupAllow=Allow pop-ups for %S
popupBlock=Block pop-ups for %S
popupWarningDontShowFromMessage=Don't show this message when pop-ups are blocked
popupWarningDontShowFromLocationbar=Don't show info bar when pop-ups are blocked
popupShowPopupPrefix=Show '%S'
# missing plugin installer

View File

@ -1314,6 +1314,11 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-image: -moz-linear-gradient(rgb(237,120,120), rgb(216,92,92));
}
/* Popup blocker button */
#page-report-button {
list-style-image: url("chrome://browser/skin/Info.png");
}
/* Star button */
#star-button {
padding: 1px;

View File

@ -1013,32 +1013,47 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
-1px -1px 1px rgba(255,255,255,.15) inset;
}
/* POPUP BLOCKER BUTTON */
#page-report-button {
list-style-image: url("chrome://browser/skin/urlbar-popup-blocked.png");
-moz-image-region: rect(0, 16px, 16px, 0);
}
#page-report-button:hover {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
#page-report-button:hover:active,
#page-report-button[open="true"] {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
/* STAR BUTTON */
#star-button {
padding: 1px;
-moz-padding-start: 4px;
list-style-image: url("chrome://browser/skin/places/star-icons.png");
-moz-image-region: rect(0px, 16px, 16px, 0px);
-moz-image-region: rect(0, 16px, 16px, 0);
}
#star-button:hover {
-moz-image-region: rect(0px, 32px, 16px, 16px);
-moz-image-region: rect(0, 32px, 16px, 16px);
}
#star-button:hover:active {
-moz-image-region: rect(0px, 48px, 16px, 32px);
-moz-image-region: rect(0, 48px, 16px, 32px);
}
#star-button[starred="true"] {
-moz-image-region: rect(16px, 16px, 32px, 0px);
-moz-image-region: rect(16px, 16px, 32px, 0);
}
#star-button:hover[starred="true"] {
-moz-image-region: rect(16px, 32px, 32px, 16px);
-moz-image-region: rect(16px, 32px, 32px, 16px);
}
#star-button:hover:active[starred="true"] {
-moz-image-region: rect(16px, 48px, 32px, 32px);
-moz-image-region: rect(16px, 48px, 32px, 32px);
}
/* BOOKMARKING PANEL */

View File

@ -47,6 +47,7 @@ browser.jar:
skin/classic/browser/Toolbar.png
skin/classic/browser/toolbarbutton-dropmarker.png
skin/classic/browser/urlbar-favicon-glow.png
skin/classic/browser/urlbar-popup-blocked.png
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css)
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1351,6 +1351,22 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-image: -moz-linear-gradient(rgb(244,156,128), rgb(215,101,77) 49%, rgb(194,66,48) 51%, rgb(170,41,23));
}
/* popup blocker button */
#page-report-button {
list-style-image: url("chrome://browser/skin/urlbar-popup-blocked.png");
-moz-image-region: rect(0, 16px, 16px, 0);
}
#page-report-button:hover {
-moz-image-region: rect(0, 32px, 16px, 16px);
}
#page-report-button:hover:active,
#page-report-button[open="true"] {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
/* star button */
#star-button {

View File

@ -47,6 +47,7 @@ browser.jar:
skin/classic/browser/monitor.png
skin/classic/browser/monitor_16-10.png
skin/classic/browser/urlbar-favicon-glow.png
skin/classic/browser/urlbar-popup-blocked.png
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
skin/classic/browser/feeds/audioFeedIcon.png (feeds/audioFeedIcon.png)
@ -159,6 +160,7 @@ browser.jar:
skin/classic/aero/browser/monitor.png
skin/classic/aero/browser/monitor_16-10.png
skin/classic/aero/browser/urlbar-favicon-glow.png
skin/classic/aero/browser/urlbar-popup-blocked.png
skin/classic/aero/browser/feeds/feedIcon.png (feeds/feedIcon-aero.png)
skin/classic/aero/browser/feeds/feedIcon16.png (feeds/feedIcon16-aero.png)
skin/classic/aero/browser/feeds/audioFeedIcon.png (feeds/audioFeedIcon-aero.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB