Commit afdeed79 authored by Michael Kaply's avatar Michael Kaply
Browse files

Bug 1586913 - Add policy for DisablePasswordReveal. r=jaws,flod,fluent-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D48592

--HG--
extra : moz-landing-system : lando
parent d84a6a95
......@@ -69,6 +69,7 @@ class AboutLoginsChild extends ActorChild {
},
// Default to enabled just in case a search is attempted before we get a response.
masterPasswordEnabled: true,
passwordRevealVisible: true,
};
waivedContent.AboutLoginsUtils = Cu.cloneInto(
AboutLoginsUtils,
......@@ -226,6 +227,8 @@ class AboutLoginsChild extends ActorChild {
this.sendToContent("Setup", message.data);
Cu.waiveXrays(this.content).AboutLoginsUtils.masterPasswordEnabled =
message.data.masterPasswordEnabled;
Cu.waiveXrays(this.content).AboutLoginsUtils.passwordRevealVisible =
message.data.passwordRevealVisible;
break;
case "AboutLogins:ShowLoginItemError":
this.sendToContent("ShowLoginItemError", message.data);
......
......@@ -411,6 +411,9 @@ var AboutLoginsParent = {
syncState,
selectedBadgeLanguages,
masterPasswordEnabled: LoginHelper.isMasterPasswordSet(),
passwordRevealVisible: Services.policies.isAllowed(
"passwordReveal"
),
});
await this._sendAllLoginRelatedObjects(logins, messageManager);
......
......@@ -727,6 +727,14 @@ export default class LoginItem extends HTMLElement {
}
_updatePasswordRevealState() {
if (
window.AboutLoginsUtils &&
!window.AboutLoginsUtils.passwordRevealVisible
) {
this._revealCheckbox.hidden = true;
return;
}
let titleId = this._revealCheckbox.checked
? "login-item-password-reveal-checkbox-hide"
: "login-item-password-reveal-checkbox-show";
......
......@@ -450,6 +450,14 @@ var Policies = {
},
},
DisablePasswordReveal: {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("passwordReveal");
}
},
},
DisablePocket: {
onBeforeAddons(manager, param) {
if (param) {
......
......@@ -211,6 +211,10 @@
"type": "boolean"
},
"DisablePasswordReveal": {
"type": "boolean"
},
"DisablePocket": {
"type": "boolean"
},
......
......@@ -54,6 +54,8 @@ policy-DisableFormHistory = Don’t remember search and form history.
policy-DisableMasterPasswordCreation = If true, a master password can’t be created.
policy-DisablePasswordReveal = Do not allow passwords to be revealed in saved logins.
policy-DisablePocket = Disable the feature to save webpages to Pocket.
policy-DisablePrivateBrowsing = Disable Private Browsing.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment