Bug 508471 - Password Manager should use setProperty instead of setPropertyAsInterface for non-interface objects. r=gavin

This commit is contained in:
Justin Dolske 2009-08-05 13:46:30 -07:00
Родитель 05bf91d574
Коммит 4b1481c0a5
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -1244,13 +1244,17 @@ LoginManager.prototype = {
*/
_notifyFoundLogins : function (didntFillReason, usernameField,
passwordField, foundLogins, selectedLogin) {
// We need .setProperty(), which is a method on the original
// nsIWritablePropertyBag. Strangley enough, nsIWritablePropertyBag2
// doesn't inherit from that, so the additional QI is needed.
let formInfo = Cc["@mozilla.org/hash-property-bag;1"].
createInstance(Ci.nsIWritablePropertyBag2);
createInstance(Ci.nsIWritablePropertyBag2).
QueryInterface(Ci.nsIWritablePropertyBag);
formInfo.setPropertyAsACString("didntFillReason", didntFillReason);
formInfo.setPropertyAsInterface("usernameField", usernameField);
formInfo.setPropertyAsInterface("passwordField", passwordField);
formInfo.setPropertyAsInterface("foundLogins", foundLogins.concat());
formInfo.setProperty("foundLogins", foundLogins.concat());
formInfo.setPropertyAsInterface("selectedLogin", selectedLogin);
this._observerService.notifyObservers(formInfo,