From 6283e8bf1ca8bb8569e737cd140c82892cb57427 Mon Sep 17 00:00:00 2001 From: Steve Chung Date: Wed, 7 Sep 2016 14:51:40 +0800 Subject: [PATCH] Bug 1288558 - Part 3: Replace usage of Components with Cc/Ci/Cu. r=MattN MozReview-Commit-ID: Goj429Tbk31 --HG-- extra : rebase_source : b9f53d47a1bd8c16a2d17b81e7424183d668f705 --- .../passwordmgr/content/passwordManager.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index db05768c2f92..6f93af2b64a9 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -60,12 +60,12 @@ let dateAndTimeFormatter = new Intl.DateTimeFormat(undefined, function Startup() { // xpconnect to password manager interfaces - passwordmanager = Components.classes["@mozilla.org/login-manager;1"] - .getService(Components.interfaces.nsILoginManager); + passwordmanager = Cc["@mozilla.org/login-manager;1"] + .getService(Ci.nsILoginManager); // be prepared to reload the display if anything changes - kObserverService = Components.classes["@mozilla.org/observer-service;1"] - .getService(Components.interfaces.nsIObserverService); + kObserverService = Cc["@mozilla.org/observer-service;1"] + .getService(Ci.nsIObserverService); kObserverService.addObserver(signonReloadDisplay, "passwordmgr-storage-changed", false); signonsTree = document.getElementById("signonsTree"); @@ -306,7 +306,7 @@ function LoadSignons() { } catch (e) { signons = []; } - signons.forEach(login => login.QueryInterface(Components.interfaces.nsILoginMetaInfo)); + signons.forEach(login => login.QueryInterface(Ci.nsILoginMetaInfo)); signonsTreeView.rowCount = signons.length; // sort and display the table @@ -433,8 +433,8 @@ function DeleteAllFromTree(tree, view, table, deletedTable, removeButton, remove } function DeleteAllSignons() { - let prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] - .getService(Components.interfaces.nsIPromptService); + let prompter = Cc["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Ci.nsIPromptService); // Confirm the user wants to remove all passwords let dummy = { value: false }; @@ -469,7 +469,7 @@ function TogglePasswordVisible() { } function AskUserShowPasswords() { - let prompter = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); + let prompter = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService); let dummy = { value: false }; // Confirm the user wants to display passwords @@ -652,8 +652,8 @@ function CopyPassword() { if (!showingPasswords && !masterPasswordLogin()) return; // Copy selected signon's password to clipboard - let clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]. - getService(Components.interfaces.nsIClipboardHelper); + let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"]. + getService(Ci.nsIClipboardHelper); let row = document.getElementById("signonsTree").currentIndex; let password = signonsTreeView.getCellText(row, {id : "passwordCol" }); clipboard.copyString(password); @@ -662,8 +662,8 @@ function CopyPassword() { function CopyUsername() { // Copy selected signon's username to clipboard - let clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]. - getService(Components.interfaces.nsIClipboardHelper); + let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"]. + getService(Ci.nsIClipboardHelper); let row = document.getElementById("signonsTree").currentIndex; let username = signonsTreeView.getCellText(row, {id : "userCol" }); clipboard.copyString(username); @@ -713,8 +713,8 @@ function UpdateContextMenu() { function masterPasswordLogin(noPasswordCallback) { // This doesn't harm if passwords are not encrypted - let tokendb = Components.classes["@mozilla.org/security/pk11tokendb;1"] - .createInstance(Components.interfaces.nsIPK11TokenDB); + let tokendb = Cc["@mozilla.org/security/pk11tokendb;1"] + .createInstance(Ci.nsIPK11TokenDB); let token = tokendb.getInternalKeyToken(); // If there is no master password, still give the user a chance to opt-out of displaying passwords