mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 374723: re-design password manager API and implement in JS rather than C++, patch by Justin Dolske <dolske@mozilla.com>, r=mconnor, r=me
This commit is contained in:
parent
83ac6de330
commit
0850ec73bc
@ -194,24 +194,17 @@ Sanitizer.prototype = {
|
||||
passwords: {
|
||||
clear: function ()
|
||||
{
|
||||
var pwmgr = Components.classes["@mozilla.org/passwordmanager;1"]
|
||||
.getService(Components.interfaces.nsIPasswordManager);
|
||||
var e = pwmgr.enumerator;
|
||||
var passwds = [];
|
||||
while (e.hasMoreElements()) {
|
||||
var passwd = e.getNext().QueryInterface(Components.interfaces.nsIPassword);
|
||||
passwds.push(passwd);
|
||||
}
|
||||
|
||||
for (var i = 0; i < passwds.length; ++i)
|
||||
pwmgr.removeUser(passwds[i].host, passwds[i].user);
|
||||
var pwmgr = Components.classes["@mozilla.org/login-manager;1"]
|
||||
.getService(Components.interfaces.nsILoginManager);
|
||||
pwmgr.removeAllLogins();
|
||||
},
|
||||
|
||||
get canClear()
|
||||
{
|
||||
var pwmgr = Components.classes["@mozilla.org/passwordmanager;1"]
|
||||
.getService(Components.interfaces.nsIPasswordManager);
|
||||
return pwmgr.enumerator.hasMoreElements();
|
||||
var pwmgr = Components.classes["@mozilla.org/login-manager;1"]
|
||||
.getService(Components.interfaces.nsILoginManager);
|
||||
var logins = pwmgr.getAllLogins({});
|
||||
return (logins.length > 0);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user