Bug 822371 - Mixed Content Doorhanger UI. r=dao

This commit is contained in:
Tanvi Vyas 2013-01-30 00:04:28 -08:00
parent c6f64baff4
commit f1d97c5c30
17 changed files with 108 additions and 1 deletions

View File

@ -757,6 +757,7 @@ pref("urlclassifier.max-complete-age", 2700);
#endif
pref("browser.geolocation.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/geolocation/");
pref("browser.mixedcontent.warning.infoURL", "http://support.mozilla.org/1/%APP%/%VERSION%/%OS%/%LOCALE%/mixed-content/");
pref("browser.EULA.version", 3);
pref("browser.rights.version", 3);

View File

@ -6648,7 +6648,7 @@ var gIdentityHandler = {
} else if (state & nsIWebProgressListener.STATE_IS_SECURE) {
this.setMode(this.IDENTITY_MODE_DOMAIN_VERIFIED);
} else if (state & nsIWebProgressListener.STATE_IS_BROKEN) {
if (gBrowser.docShell.hasMixedActiveContentLoaded) {
if (state & nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT) {
this.setMode(this.IDENTITY_MODE_MIXED_ACTIVE_CONTENT);
} else {
this.setMode(this.IDENTITY_MODE_MIXED_CONTENT);
@ -6656,6 +6656,48 @@ var gIdentityHandler = {
} else {
this.setMode(this.IDENTITY_MODE_UNKNOWN);
}
// Ensure the doorhanger is shown when mixed active content is blocked.
if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT)
this.showMixedContentDoorhanger();
},
/**
* Display the Mixed Content Blocker doohanger, providing an option
* to the user to override mixed content blocking
*/
showMixedContentDoorhanger : function() {
// If we've already got an active notification, bail out to avoid showing it repeatedly.
if (PopupNotifications.getNotification("mixed-content-blocked", gBrowser.selectedBrowser))
return;
let helplink = document.getElementById("mixed-content-blocked-helplink");
helplink.href = Services.urlFormatter.formatURLPref("browser.mixedcontent.warning.infoURL");
let brandBundle = document.getElementById("bundle_brand");
let brandShortName = brandBundle.getString("brandShortName");
let messageString = gNavigatorBundle.getFormattedString("mixedContentBlocked.message", [brandShortName]);
let action = {
label: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.label"),
accessKey: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.accesskey"),
callback: function() { /* NOP */ }
};
let secondaryActions = [
{
label: gNavigatorBundle.getString("mixedContentBlocked.unblock.label"),
accessKey: gNavigatorBundle.getString("mixedContentBlocked.unblock.accesskey"),
callback: function() {
// Reload the page with the content unblocked
BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT);
}
}
];
let options = {
dismissed: true,
};
PopupNotifications.show(gBrowser.selectedBrowser, "mixed-content-blocked",
messageString, "mixed-content-blocked-notification-icon",
action, secondaryActions, options);
},
/**

View File

@ -473,6 +473,17 @@
<label id="geolocation-learnmore-link" class="text-link"/>
</popupnotificationcontent>
</popupnotification>
<popupnotification id="mixed-content-blocked-notification" hidden="true">
<popupnotificationcontent orient="vertical" align="start">
<separator/>
<description id="mixed-content-blocked-moreinfo">&mixedContentBlocked.moreinfo;</description>
<separator/>
<label id="mixed-content-blocked-helplink" class="text-link"
value="&mixedContentBlocked.helplink;"/>
</popupnotificationcontent>
</popupnotification>
</popupset>
#ifdef CAN_DRAW_IN_TITLEBAR
@ -587,6 +598,7 @@
<image id="webapps-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="blocked-plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="mixed-content-blocked-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"/>
</box>

View File

@ -631,3 +631,6 @@ just addresses the organization to follow, e.g. "This site is run by " -->
<!ENTITY webrtcIndicatorButton.label "Camera / Microphone Access">
<!ENTITY webrtcIndicatorButton.tooltip "Display sites you are currently sharing your camera or microphone with">
<!ENTITY mixedContentBlocked.helplink "Learn more">
<!ENTITY mixedContentBlocked.moreinfo "Most websites will still work properly even when this content is blocked.">

View File

@ -435,3 +435,11 @@ getUserMedia.denyRequest.accesskey = D
getUserMedia.sharingCamera.message = You are currently sharing your camera with %S.
getUserMedia.sharingMicrophone.message = You are currently sharing your microphone with %S.
getUserMedia.sharingCameraAndMicrophone.message = You are currently sharing your camera and microphone with %S.
# Mixed Content Blocker Doorhanger Notification
# LOCALIZATION NOTE - %S is brandShortName
mixedContentBlocked.message = %S has blocked content that isn't secure.
mixedContentBlocked.keepBlockingButton.label = Keep Blocking
mixedContentBlocked.keepBlockingButton.accesskey = B
mixedContentBlocked.unblock.label = Disable Protection on This Page
mixedContentBlocked.unblock.accesskey = D

View File

@ -1302,6 +1302,10 @@ toolbar[iconsize="small"] #webrtc-status-button {
}
}
#mixed-content-blocked-notification-icon {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
}
#webRTC-shareDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
}

View File

@ -30,6 +30,7 @@ browser.jar:
skin/classic/browser/identity-icons-https-mixed-active.png
skin/classic/browser/Info.png
skin/classic/browser/KUI-close.png
skin/classic/browser/mixed-content-blocked-16.png
skin/classic/browser/monitor.png
skin/classic/browser/monitor_16-10.png
* skin/classic/browser/pageInfo.css

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

View File

@ -3095,6 +3095,15 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
}
}
#mixed-content-blocked-notification-icon {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
}
@media (min-resolution: 2dppx) {
#mixed-content-blocked-notification-icon {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-16@2x.png);
}
}
#webRTC-shareDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
}
@ -3188,6 +3197,19 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
list-style-image: url(chrome://browser/skin/webapps-64.png);
}
.popup-notification-icon[popupid="mixed-content-blocked"] {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-64.png);
}
@media (min-resolution: 2dppx) {
.popup-notification-icon[popupid="mixed-content-blocked"] {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-64@2x.png);
}
}
#mixed-content-blocked-helplink {
margin: 0px;
}
.popup-notification-icon[popupid="webRTC-sharingDevices"],
.popup-notification-icon[popupid="webRTC-shareDevices"] {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);

View File

@ -40,6 +40,10 @@ browser.jar:
skin/classic/browser/KUI-close.png
skin/classic/browser/menu-back.png
skin/classic/browser/menu-forward.png
skin/classic/browser/mixed-content-blocked-16.png
skin/classic/browser/mixed-content-blocked-16@2x.png
skin/classic/browser/mixed-content-blocked-64.png
skin/classic/browser/mixed-content-blocked-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.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -2304,6 +2304,10 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
list-style-image: url(chrome://browser/skin/webapps-64.png);
}
.popup-notification-icon[popupid="mixed-content-blocked"] {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-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);
@ -2391,6 +2395,10 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
}
}
#mixed-content-blocked-notification-icon {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
}
#webRTC-shareDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
}

View File

@ -38,6 +38,7 @@ browser.jar:
skin/classic/browser/livemark-folder.png
skin/classic/browser/menu-back.png
skin/classic/browser/menu-forward.png
skin/classic/browser/mixed-content-blocked-16.png
skin/classic/browser/monitor.png
skin/classic/browser/monitor_16-10.png
skin/classic/browser/pageInfo.css
@ -265,6 +266,7 @@ browser.jar:
skin/classic/aero/browser/livemark-folder.png (livemark-folder-aero.png)
skin/classic/aero/browser/menu-back.png (menu-back-aero.png)
skin/classic/aero/browser/menu-forward.png (menu-forward-aero.png)
skin/classic/aero/browser/mixed-content-blocked-16.png
skin/classic/aero/browser/monitor.png
skin/classic/aero/browser/monitor_16-10.png
skin/classic/aero/browser/pageInfo.css

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B