зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1193004
- Always show permissions section in the Control Center r=bgrins
This commit is contained in:
Родитель
36d322047e
Коммит
ce9b360431
|
@ -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,21 @@ add_task(function* testMainViewVisible() {
|
|||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
yield promiseTabLoadEvent(tab, PERMISSIONS_PAGE);
|
||||
|
||||
// Retrieve the label that's shown when the user didn't grant the page any
|
||||
// special permissions.
|
||||
let emptyLabel = document.querySelector("#identity-popup-permission-list + description");
|
||||
|
||||
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 permissionsList = document.getElementById("identity-popup-permission-list");
|
||||
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 +41,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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче