Bug 1193004 - Always show permissions section in the Control Center r=bgrins

This commit is contained in:
Tim Taubert 2015-09-16 12:51:19 +02:00
Родитель 4cbe7f3464
Коммит 4a63c69f3a
5 изменённых файлов: 17 добавлений и 14 удалений

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

@ -6807,10 +6807,6 @@ var gIdentityHandler = {
delete this._identityIcon;
return this._identityIcon = document.getElementById("page-proxy-favicon");
},
get _permissionsContainer () {
delete this._permissionsContainer;
return this._permissionsContainer = document.getElementById("identity-popup-permissions");
},
get _permissionList () {
delete this._permissionList;
return this._permissionList = document.getElementById("identity-popup-permission-list");
@ -6826,14 +6822,12 @@ var gIdentityHandler = {
delete this._identityIconLabel;
delete this._identityIconCountryLabel;
delete this._identityIcon;
delete this._permissionsContainer;
delete this._permissionList;
this._identityBox = document.getElementById("identity-box");
this._identityIcons = document.getElementById("identity-icons");
this._identityIconLabel = document.getElementById("identity-icon-label");
this._identityIconCountryLabel = document.getElementById("identity-icon-country-label");
this._identityIcon = document.getElementById("page-proxy-favicon");
this._permissionsContainer = document.getElementById("identity-popup-permissions");
this._permissionList = document.getElementById("identity-popup-permission-list");
},
@ -7325,8 +7319,6 @@ var gIdentityHandler = {
let item = this._createPermissionItem(permission, state);
this._permissionList.appendChild(item);
}
this._permissionsContainer.hidden = !this._permissionList.hasChildNodes();
},
setPermission: function (aPermission, aState) {

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

@ -18,15 +18,19 @@ add_task(function* testMainViewVisible() {
let tab = gBrowser.selectedTab = gBrowser.addTab();
yield promiseTabLoadEvent(tab, PERMISSIONS_PAGE);
let permissionsList = document.getElementById("identity-popup-permission-list");
let emptyLabel = permissionsList.nextSibling;
gIdentityHandler._identityBox.click();
ok(is_hidden(gIdentityHandler._permissionsContainer), "The container is hidden");
ok(!is_hidden(emptyLabel), "List of permissions is empty");
gIdentityHandler._identityPopup.hidden = true;
gIdentityHandler.setPermission("install", 1);
gIdentityHandler._identityBox.click();
ok(!is_hidden(gIdentityHandler._permissionsContainer), "The container is visible");
let menulists = gIdentityHandler._permissionsContainer.querySelectorAll("menulist");
ok(is_hidden(emptyLabel), "List of permissions is not empty");
let menulists = permissionsList.querySelectorAll("menulist");
is(menulists.length, 1, "One permission visible in main view");
is(menulists[0].id, "identity-popup-permission:install", "Install permission visible");
is(menulists[0].value, "1", "Correct value on install menulist");
@ -35,6 +39,6 @@ add_task(function* testMainViewVisible() {
gIdentityHandler.setPermission("install", SitePermissions.getDefault("install"));
gIdentityHandler._identityBox.click();
ok(is_hidden(gIdentityHandler._permissionsContainer), "The container is hidden");
ok(!is_hidden(emptyLabel), "List of permissions is empty");
gIdentityHandler._identityPopup.hidden = true;
});

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

@ -81,11 +81,12 @@
</hbox>
<!-- Permissions Section -->
<hbox id="identity-popup-permissions" class="identity-popup-section">
<hbox class="identity-popup-section">
<vbox id="identity-popup-permissions-content" flex="1">
<label class="identity-popup-headline"
value="&identity.permissions;"/>
<vbox id="identity-popup-permission-list"/>
<description>&identity.permissionsEmpty;</description>
</vbox>
</hbox>
</panelview>

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

@ -733,6 +733,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY identity.moreInfoLinkText2 "More Information">
<!ENTITY identity.permissions "Permissions">
<!ENTITY identity.permissionsEmpty "You have not granted this site any special permissions.">
<!-- Name for the tabs toolbar as spoken by screen readers.
The word "toolbar" is appended automatically and should not be contained below! -->

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

@ -159,6 +159,7 @@
#identity-popup-security-descriptions > description,
#identity-popup-securityView-header > description,
#identity-popup-securityView-body > description,
#identity-popup-permissions-content > description,
#tracking-protection-content > label {
white-space: pre-wrap;
font-size: 110%;
@ -288,10 +289,14 @@ description#identity-popup-content-verifier,
background-image: url(chrome://browser/skin/controlcenter/permissions.svg);
}
#identity-popup-permission-list {
#identity-popup-permission-list:not(:empty) {
margin-top: 5px;
}
#identity-popup-permission-list:not(:empty) + description {
display: none;
}
.identity-popup-permission-label {
-moz-margin-start: 0;
}