From 1b9bf3c87544262650baca8f391011b30cfc9f6d Mon Sep 17 00:00:00 2001 From: "mozilla.mano@sent.com" Date: Mon, 14 May 2007 22:55:21 -0700 Subject: [PATCH] Bug 266945 - Add confirm prompt for 'Remove All' operation in Password Manager. r+a181=mconnor. --- .../passwordmgr/content/passwordManager.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index 9d4f947666a6..4b6c4926bbe0 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -163,6 +163,19 @@ function DeleteSignon() { } function DeleteAllSignons() { + var prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + + // Confirm the user wants to remove all passwords + var dummy = { value: false }; + if (prompter.confirmEx(window, + null, + kSignonBundle.getString("removeAllPasswordsPrompt"), + prompter.BUTTON_TITLE_YES * prompter.BUTTON_POS_0 + + prompter.BUTTON_TITLE_NO * prompter.BUTTON_POS_1, + null, null, null, null, dummy) == 1) //1 = "No" button + return; + DeleteAllFromTree(signonsTree, signonsTreeView, signons, deletedSignons, "removeSignon", "removeAllSignons");