From 54229a92e650c9853dff1636b55b09faa5ffb3a3 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Fri, 4 Jan 2008 22:06:30 -0800 Subject: [PATCH] Bug 381692 - "Page Info Security section should show site-specific saved passwords" [p=ehsan.akhgari@gmail.com (Ehsan Akhgari) r=Mano ui-r=johnath a1.9=schrep] --- browser/base/content/pageinfo/security.js | 8 ++++++-- .../passwordmgr/content/passwordManager.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/browser/base/content/pageinfo/security.js b/browser/base/content/pageinfo/security.js index 765b166d2e58..34b5e38fb9e3 100644 --- a/browser/base/content/pageinfo/security.js +++ b/browser/base/content/pageinfo/security.js @@ -22,6 +22,7 @@ # Contributor(s): # Terry Hayes # Florian QUEZE +# Ehsan Akhgari # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -159,11 +160,14 @@ var security = { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var win = wm.getMostRecentWindow("Toolkit:PasswordManager"); - if (win) + if (win) { + win.setFilter(this._getSecurityInfo().hostName); win.focus(); + } else window.openDialog("chrome://passwordmgr/content/passwordManager.xul", - "Toolkit:PasswordManager", ""); + "Toolkit:PasswordManager", "", + {filterString : this._getSecurityInfo().hostName}); }, _cert : null diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index 1ee2c332af6e..914813b6cf33 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -25,6 +25,7 @@ # Ben "Count XULula" Goodger # Brian Ryner # Ehsan Akhgari +# Ronny Perinke # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -49,6 +50,12 @@ function SignonsStartup() { document.getElementById("togglePasswords").label = kSignonBundle.getString("showPasswords"); document.getElementById("togglePasswords").accessKey = kSignonBundle.getString("showPasswordsAccessKey"); LoadSignons(); + + // filter the table if requested by caller + if (window.arguments && window.arguments[0] && + window.arguments[0].filterString) + setFilter(window.arguments[0].filterString); + FocusFilterBox(); } @@ -322,3 +329,10 @@ function HandleSignonFilterKeyPress(aEvent) { if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) SignonClearFilter(); } + +function setFilter(aFilterString) { + if (document.getElementById("filter").value != "") + SignonClearFilter(); + document.getElementById("filter").value = aFilterString; + _filterPasswords(); +}