Bug 435035 - Use different strings for mixed content in the identity UI. r=johnath, ui-r=faaborg

This commit is contained in:
Dão Gottwald 2009-09-11 19:28:55 +02:00
Родитель c695f6ea25
Коммит a6fdb48b85
5 изменённых файлов: 39 добавлений и 17 удалений

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

@ -6317,25 +6317,25 @@ var gIdentityHandler = {
IDENTITY_MODE_IDENTIFIED : "verifiedIdentity", // High-quality identity information
IDENTITY_MODE_DOMAIN_VERIFIED : "verifiedDomain", // Minimal SSL CA-signed domain verification
IDENTITY_MODE_UNKNOWN : "unknownIdentity", // No trusted identity information
IDENTITY_MODE_MIXED_CONTENT : "unknownIdentity mixedContent", // SSL with unauthenticated content
// Cache the most recent SSLStatus and Location seen in checkIdentity
_lastStatus : null,
_lastLocation : null,
// smart getters
get _staticStrings () {
delete this._staticStrings;
this._staticStrings = {};
this._staticStrings[this.IDENTITY_MODE_DOMAIN_VERIFIED] = {
encryption_label: gNavigatorBundle.getString("identity.encrypted")
};
this._staticStrings[this.IDENTITY_MODE_IDENTIFIED] = {
encryption_label: gNavigatorBundle.getString("identity.encrypted")
};
this._staticStrings[this.IDENTITY_MODE_UNKNOWN] = {
encryption_label: gNavigatorBundle.getString("identity.unencrypted")
};
return this._staticStrings;
get _encryptionLabel () {
delete this._encryptionLabel;
this._encryptionLabel = {};
this._encryptionLabel[this.IDENTITY_MODE_DOMAIN_VERIFIED] =
gNavigatorBundle.getString("identity.encrypted");
this._encryptionLabel[this.IDENTITY_MODE_IDENTIFIED] =
gNavigatorBundle.getString("identity.encrypted");
this._encryptionLabel[this.IDENTITY_MODE_UNKNOWN] =
gNavigatorBundle.getString("identity.unencrypted");
this._encryptionLabel[this.IDENTITY_MODE_MIXED_CONTENT] =
gNavigatorBundle.getString("identity.mixed_content");
return this._encryptionLabel;
},
get _identityPopup () {
delete this._identityPopup;
@ -6453,11 +6453,14 @@ var gIdentityHandler = {
.SSLStatus;
this._lastStatus = currentStatus;
this._lastLocation = location;
if (state & Components.interfaces.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL)
let nsIWebProgressListener = Ci.nsIWebProgressListener;
if (state & nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL)
this.setMode(this.IDENTITY_MODE_IDENTIFIED);
else if (state & Components.interfaces.nsIWebProgressListener.STATE_SECURE_HIGH)
else if (state & nsIWebProgressListener.STATE_SECURE_HIGH)
this.setMode(this.IDENTITY_MODE_DOMAIN_VERIFIED);
else if (state & nsIWebProgressListener.STATE_IS_BROKEN)
this.setMode(this.IDENTITY_MODE_MIXED_CONTENT);
else
this.setMode(this.IDENTITY_MODE_UNKNOWN);
},
@ -6577,7 +6580,7 @@ var gIdentityHandler = {
this._identityPopupContentBox.className = newMode;
// Set the static strings up front
this._identityPopupEncLabel.textContent = this._staticStrings[newMode].encryption_label;
this._identityPopupEncLabel.textContent = this._encryptionLabel[newMode];
// Initialize the optional strings to empty values
var supplemental = "";

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

@ -91,6 +91,7 @@ _BROWSER_FILES = \
browser_bug424101.js \
browser_bug427559.js \
browser_bug432599.js \
browser_bug435035.js \
browser_bug441778.js \
browser_bug455852.js \
browser_bug462673.js \
@ -101,6 +102,7 @@ _BROWSER_FILES = \
browser_tabfocus.js \
discovery.html \
moz.png \
test_bug435035.html \
test_bug462673.html \
browser_getshortcutoruri.js \
browser_page_style_menu.js \

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

@ -0,0 +1,15 @@
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function () {
is(document.getElementById("identity-box").className,
gIdentityHandler.IDENTITY_MODE_MIXED_CONTENT,
"identity box has class name for mixed content");
gBrowser.removeCurrentTab();
finish();
}, true);
content.location = "https://example.com/browser/browser/base/content/test/test_bug435035.html";
}

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

@ -0,0 +1 @@
<img src="http://example.com/browser/browser/base/content/test/moz.png">

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

@ -150,6 +150,7 @@ identity.identified.title_with_country=%S (%S)
identity.encrypted=Your connection to this web site is encrypted to prevent eavesdropping.
identity.unencrypted=Your connection to this web site is not encrypted.
identity.mixed_content=Your connection to this site is only partially encrypted, and does not prevent eavesdropping.
identity.unknown.tooltip=This web site does not supply identity information.