diff --git a/browser/actors/ContextMenuChild.jsm b/browser/actors/ContextMenuChild.jsm index de51703c042b..15338949b814 100644 --- a/browser/actors/ContextMenuChild.jsm +++ b/browser/actors/ContextMenuChild.jsm @@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { BrowserUtils: "resource://gre/modules/BrowserUtils.jsm", findAllCssSelectors: "resource://gre/modules/css-selector.js", SpellCheckHelper: "resource://gre/modules/InlineSpellChecker.jsm", - LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm", + LoginManagerChild: "resource://gre/modules/LoginManagerChild.jsm", WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm", InlineSpellCheckerContent: @@ -561,7 +561,7 @@ class ContextMenuChild extends JSWindowActorChild { } = doc; docLocation = docLocation && docLocation.spec; let frameOuterWindowID = WebNavigationFrames.getFrameId(doc.defaultView); - let loginFillInfo = LoginManagerContent.forWindow( + let loginFillInfo = LoginManagerChild.forWindow( doc.defaultView ).getFieldContext(aEvent.composedTarget); diff --git a/browser/base/content/content.js b/browser/base/content/content.js index db0929fe38c6..1f3d404f4c51 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -16,18 +16,18 @@ var { XPCOMUtils } = ChromeUtils.import( XPCOMUtils.defineLazyModuleGetters(this, { ContentMetaHandler: "resource:///modules/ContentMetaHandler.jsm", LoginFormFactory: "resource://gre/modules/LoginFormFactory.jsm", - LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm", + LoginManagerChild: "resource://gre/modules/LoginManagerChild.jsm", InsecurePasswordUtils: "resource://gre/modules/InsecurePasswordUtils.jsm", }); // NOTE: Much of this logic is duplicated in BrowserCLH.js for Android. addMessageListener("PasswordManager:fillForm", function(message) { // intercept if ContextMenu.jsm had sent a plain object for remote targets - LoginManagerContent.receiveMessage(message, content); + LoginManagerChild.receiveMessage(message, content); }); addMessageListener("PasswordManager:fillGeneratedPassword", function(message) { // forward message to LMC - LoginManagerContent.receiveMessage(message, content); + LoginManagerChild.receiveMessage(message, content); }); function shouldIgnoreLoginManagerEvent(event) { @@ -45,13 +45,13 @@ addEventListener("DOMFormBeforeSubmit", function(event) { if (shouldIgnoreLoginManagerEvent(event)) { return; } - this.LoginManagerContent.forWindow(content).onDOMFormBeforeSubmit(event); + this.LoginManagerChild.forWindow(content).onDOMFormBeforeSubmit(event); }); addEventListener("DOMFormHasPassword", function(event) { if (shouldIgnoreLoginManagerEvent(event)) { return; } - this.LoginManagerContent.forWindow(content).onDOMFormHasPassword(event); + this.LoginManagerChild.forWindow(content).onDOMFormHasPassword(event); let formLike = LoginFormFactory.createFromForm(event.originalTarget); InsecurePasswordUtils.reportInsecurePasswords(formLike); }); @@ -59,7 +59,7 @@ addEventListener("DOMInputPasswordAdded", function(event) { if (shouldIgnoreLoginManagerEvent(event)) { return; } - this.LoginManagerContent.forWindow(content).onDOMInputPasswordAdded( + this.LoginManagerChild.forWindow(content).onDOMInputPasswordAdded( event, content ); diff --git a/mobile/android/chrome/content/content.js b/mobile/android/chrome/content/content.js index ed920fef2967..a8604e382322 100644 --- a/mobile/android/chrome/content/content.js +++ b/mobile/android/chrome/content/content.js @@ -25,8 +25,8 @@ ChromeUtils.defineModuleGetter( ); ChromeUtils.defineModuleGetter( this, - "LoginManagerContent", - "resource://gre/modules/LoginManagerContent.jsm" + "LoginManagerChild", + "resource://gre/modules/LoginManagerChild.jsm" ); XPCOMUtils.defineLazyGetter(this, "gPipNSSBundle", function() { @@ -640,7 +640,7 @@ var AboutReaderListener = { AboutReaderListener.init(); addMessageListener("PasswordManager:fillForm", function(message) { - LoginManagerContent.receiveMessage(message, content); + LoginManagerChild.receiveMessage(message, content); }); Services.obs.notifyObservers(this, "tab-content-frameloader-created"); diff --git a/mobile/android/components/BrowserCLH.js b/mobile/android/components/BrowserCLH.js index 4d7314c78064..07737f19218b 100644 --- a/mobile/android/components/BrowserCLH.js +++ b/mobile/android/components/BrowserCLH.js @@ -87,8 +87,8 @@ BrowserCLH.prototype = { // BrowserGlue.jsm ], }); - GeckoViewUtils.addLazyGetter(this, "LoginManagerContent", { - module: "resource://gre/modules/LoginManagerContent.jsm", + GeckoViewUtils.addLazyGetter(this, "LoginManagerChild", { + module: "resource://gre/modules/LoginManagerChild.jsm", }); GeckoViewUtils.addLazyGetter(this, "ActionBarHandler", { @@ -228,7 +228,7 @@ BrowserCLH.prototype = { if (shouldIgnoreLoginManagerEvent(event)) { return; } - this.LoginManagerContent.forWindow(aWindow).onDOMFormBeforeSubmit(event); + this.LoginManagerChild.forWindow(aWindow).onDOMFormBeforeSubmit(event); }); aWindow.addEventListener( "DOMFormHasPassword", @@ -236,7 +236,7 @@ BrowserCLH.prototype = { if (shouldIgnoreLoginManagerEvent(event)) { return; } - this.LoginManagerContent.forWindow(aWindow).onDOMFormHasPassword(event); + this.LoginManagerChild.forWindow(aWindow).onDOMFormHasPassword(event); }, options ); @@ -247,7 +247,7 @@ BrowserCLH.prototype = { if (shouldIgnoreLoginManagerEvent(event)) { return; } - this.LoginManagerContent.forWindow(aWindow).onDOMInputPasswordAdded( + this.LoginManagerChild.forWindow(aWindow).onDOMInputPasswordAdded( event, event.target.ownerGlobal.top ); @@ -260,7 +260,7 @@ BrowserCLH.prototype = { event => { // XXXbz what about non-HTML documents?? if (ChromeUtils.getClassName(event.target) == "HTMLDocument") { - this.LoginManagerContent.forWindow(aWindow).onPageShow(event); + this.LoginManagerChild.forWindow(aWindow).onPageShow(event); } }, options diff --git a/mobile/android/modules/geckoview/GeckoViewAutofill.jsm b/mobile/android/modules/geckoview/GeckoViewAutofill.jsm index 46a873edca8b..ac52a61c054f 100644 --- a/mobile/android/modules/geckoview/GeckoViewAutofill.jsm +++ b/mobile/android/modules/geckoview/GeckoViewAutofill.jsm @@ -16,7 +16,7 @@ const { GeckoViewUtils } = ChromeUtils.import( XPCOMUtils.defineLazyModuleGetters(this, { DeferredTask: "resource://gre/modules/DeferredTask.jsm", FormLikeFactory: "resource://gre/modules/FormLikeFactory.jsm", - LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm", + LoginManagerChild: "resource://gre/modules/LoginManagerChild.jsm", }); const { debug, warn } = GeckoViewUtils.initLogging("Autofill"); // eslint-disable-line no-unused-vars @@ -140,7 +140,7 @@ class GeckoViewAutofill { return info; }; - // Get password field to get better form data via LoginManagerContent. + // Get password field to get better form data via LoginManagerChild. let passwordField; for (const field of aFormLike.elements) { if ( @@ -152,7 +152,7 @@ class GeckoViewAutofill { } } - const [usernameField] = LoginManagerContent.forWindow( + const [usernameField] = LoginManagerChild.forWindow( window ).getUserNameAndPasswordFields(passwordField || aFormLike.elements[0]); diff --git a/toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm b/toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm index 21758ed6f613..2fd111b7775b 100644 --- a/toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm +++ b/toolkit/components/passwordmgr/LoginAutoCompleteResult.jsm @@ -37,8 +37,8 @@ ChromeUtils.defineModuleGetter( ); ChromeUtils.defineModuleGetter( this, - "LoginManagerContent", - "resource://gre/modules/LoginManagerContent.jsm" + "LoginManagerChild", + "resource://gre/modules/LoginManagerChild.jsm" ); XPCOMUtils.defineLazyServiceGetter( @@ -426,7 +426,7 @@ LoginAutoComplete.prototype = { // want the same treatment: // * The web console warnings will be confusing (as they're primarily about http:) and not very // useful if the developer intentionally sandboxed the document. - // * The site identity insecure field warning would require LoginManagerContent being loaded and + // * The site identity insecure field warning would require LoginManagerChild being loaded and // listening to some of the DOM events we're ignoring in null principal documents. For memory // reasons it's better to not load LMC at all for these sandboxed frames. Also, if the top- // document is sandboxing a document, it probably doesn't want that sandboxed document to be @@ -505,7 +505,7 @@ LoginAutoComplete.prototype = { previousResult = null; } - let loginManager = LoginManagerContent.forWindow(aElement.ownerGlobal); + let loginManager = LoginManagerChild.forWindow(aElement.ownerGlobal); let acLookupPromise = (this._autoCompleteLookupPromise = loginManager._autoCompleteSearchAsync( aSearchString, previousResult, diff --git a/toolkit/components/passwordmgr/LoginManager.jsm b/toolkit/components/passwordmgr/LoginManager.jsm index 6c63d63d84d1..116ec8a29205 100644 --- a/toolkit/components/passwordmgr/LoginManager.jsm +++ b/toolkit/components/passwordmgr/LoginManager.jsm @@ -24,8 +24,8 @@ ChromeUtils.defineModuleGetter( ); ChromeUtils.defineModuleGetter( this, - "LoginManagerContent", - "resource://gre/modules/LoginManagerContent.jsm" + "LoginManagerChild", + "resource://gre/modules/LoginManagerChild.jsm" ); ChromeUtils.defineModuleGetter( this, diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerChild.jsm similarity index 98% rename from toolkit/components/passwordmgr/LoginManagerContent.jsm rename to toolkit/components/passwordmgr/LoginManagerChild.jsm index f4f9e989772c..8e8f0e3fb39c 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerChild.jsm @@ -11,7 +11,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["LoginManagerContent"]; +const EXPORTED_SYMBOLS = ["LoginManagerChild"]; const PASSWORD_INPUT_ADDED_COALESCING_THRESHOLD_MS = 1; const AUTOCOMPLETE_AFTER_RIGHT_CLICK_THRESHOLD_MS = 400; @@ -80,7 +80,7 @@ XPCOMUtils.defineLazyServiceGetter( ); XPCOMUtils.defineLazyGetter(this, "log", () => { - let logger = LoginHelper.createLogger("LoginManagerContent"); + let logger = LoginHelper.createLogger("LoginManagerChild"); return logger.log.bind(logger); }); @@ -88,7 +88,7 @@ Services.cpmm.addMessageListener("clearRecipeCache", () => { LoginRecipesContent._clearRecipeCache(); }); -let gLoginManagerContentSingleton = null; +let gLoginManagerChildSingleton = null; let _messages = [ "PasswordManager:loginsFound", @@ -120,7 +120,7 @@ const observer = { aWebProgress.DOMWindow.document ); - LoginManagerContent.forWindow(aWebProgress.DOMWindow)._onNavigation( + LoginManagerChild.forWindow(aWebProgress.DOMWindow)._onNavigation( aWebProgress.DOMWindow.document ); }, @@ -132,7 +132,7 @@ const observer = { ) { // Re-fill a document restored from bfcache since password field values // aren't persisted there. - LoginManagerContent.forWindow(aWebProgress.DOMWindow)._onDocumentRestored( + LoginManagerChild.forWindow(aWebProgress.DOMWindow)._onDocumentRestored( aWebProgress.DOMWindow.document ); return; @@ -167,7 +167,7 @@ const observer = { } log("onStateChange handled:", channel); - LoginManagerContent.forWindow(aWebProgress.DOMWindow)._onNavigation( + LoginManagerChild.forWindow(aWebProgress.DOMWindow)._onNavigation( aWebProgress.DOMWindow.document ); }, @@ -190,17 +190,17 @@ const observer = { } let window = focusedInput.ownerGlobal; - let loginManagerContent = LoginManagerContent.forWindow(window); + let loginManagerChild = LoginManagerChild.forWindow(window); let style = input.controller.getStyleAt(selectedIndex); if (style == "login" || style == "loginWithOrigin") { let details = JSON.parse( input.controller.getCommentAt(selectedIndex) ); - loginManagerContent.onFieldAutoComplete(focusedInput, details.guid); + loginManagerChild.onFieldAutoComplete(focusedInput, details.guid); } else if (style == "generatedPassword") { - loginManagerContent._highlightFilledField(focusedInput); - loginManagerContent._generatedPasswordFilledOrEdited(focusedInput); + loginManagerChild._highlightFilledField(focusedInput); + loginManagerChild._generatedPasswordFilledOrEdited(focusedInput); } break; } @@ -223,7 +223,7 @@ const observer = { // Used to mask fields with filled generated passwords when blurred. case "blur": { let unmask = false; - LoginManagerContent.forWindow(window)._togglePasswordFieldMasking( + LoginManagerChild.forWindow(window)._togglePasswordFieldMasking( aEvent.target, unmask ); @@ -232,7 +232,7 @@ const observer = { // Used to watch for changes to fields filled with generated passwords. case "change": { - LoginManagerContent.forWindow(window)._generatedPasswordFilledOrEdited( + LoginManagerChild.forWindow(window)._generatedPasswordFilledOrEdited( aEvent.target ); break; @@ -240,7 +240,7 @@ const observer = { // Used to watch for changes to fields filled with generated passwords. case "input": { - LoginManagerContent.forWindow( + LoginManagerChild.forWindow( window )._maybeStopTreatingAsGeneratedPasswordField(aEvent); break; @@ -251,7 +251,7 @@ const observer = { aEvent.keyCode == aEvent.DOM_VK_TAB || aEvent.keyCode == aEvent.DOM_VK_RETURN ) { - LoginManagerContent.forWindow(window).onUsernameAutocompleted( + LoginManagerChild.forWindow(window).onUsernameAutocompleted( aEvent.target ); } @@ -262,7 +262,7 @@ const observer = { if (aEvent.target.type == "password") { // Used to unmask fields with filled generated passwords when focused. let unmask = true; - LoginManagerContent.forWindow(window)._togglePasswordFieldMasking( + LoginManagerChild.forWindow(window)._togglePasswordFieldMasking( aEvent.target, unmask ); @@ -270,7 +270,7 @@ const observer = { } // Only used for username fields. - LoginManagerContent.forWindow(window)._onUsernameFocus(aEvent); + LoginManagerChild.forWindow(window)._onUsernameFocus(aEvent); break; } @@ -364,7 +364,7 @@ let gAutoCompleteListener = { }, }; -this.LoginManagerContent = class LoginManagerContent { +this.LoginManagerChild = class LoginManagerChild { constructor() { /** * WeakMap of the root element of a LoginForm to the DeferredTask to fill its fields. @@ -403,11 +403,10 @@ this.LoginManagerContent = class LoginManagerContent { static forWindow(window) { // For now, this is a singleton. - if (!gLoginManagerContentSingleton) { - gLoginManagerContentSingleton = new LoginManagerContent(); + if (!gLoginManagerChildSingleton) { + gLoginManagerChildSingleton = new LoginManagerChild(); } - - return gLoginManagerContentSingleton; + return gLoginManagerChildSingleton; } _getRandomId() { diff --git a/toolkit/components/passwordmgr/LoginManagerParent.jsm b/toolkit/components/passwordmgr/LoginManagerParent.jsm index 5381983d7dc6..21069f3a9867 100644 --- a/toolkit/components/passwordmgr/LoginManagerParent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm @@ -240,7 +240,7 @@ class LoginManagerParent { /** * Trigger a login form fill and send relevant data (e.g. logins and recipes) - * to the child process (LoginManagerContent). + * to the child process (LoginManagerChild). */ async fillForm({ browser, loginFormOrigin, login, inputElementIdentifier }) { let recipes = []; @@ -268,7 +268,7 @@ class LoginManagerParent { } /** - * Send relevant data (e.g. logins and recipes) to the child process (LoginManagerContent). + * Send relevant data (e.g. logins and recipes) to the child process (LoginManagerChild). */ async sendLoginDataToChild( formOrigin, @@ -401,7 +401,7 @@ class LoginManagerParent { timeDiff / 1000 )} seconds ago.` ); - // Send an empty array to make LoginManagerContent clear the + // Send an empty array to make LoginManagerChild clear the // outstanding request it has temporarily saved. target.messageManager.sendAsyncMessage( "PasswordManager:loginsAutoCompleted", diff --git a/toolkit/components/passwordmgr/moz.build b/toolkit/components/passwordmgr/moz.build index bc2fd493d38d..17373453b6ab 100644 --- a/toolkit/components/passwordmgr/moz.build +++ b/toolkit/components/passwordmgr/moz.build @@ -37,7 +37,7 @@ EXTRA_JS_MODULES += [ 'LoginHelper.jsm', 'LoginInfo.jsm', 'LoginManager.jsm', - 'LoginManagerContent.jsm', + 'LoginManagerChild.jsm', 'LoginManagerParent.jsm', 'LoginManagerPrompter.jsm', 'LoginRecipes.jsm', diff --git a/toolkit/components/passwordmgr/test/browser/browser_autofill_track_filled_logins.js b/toolkit/components/passwordmgr/test/browser/browser_autofill_track_filled_logins.js index ae357c8c98ba..74f98fc36274 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_autofill_track_filled_logins.js +++ b/toolkit/components/passwordmgr/test/browser/browser_autofill_track_filled_logins.js @@ -64,8 +64,8 @@ add_task(async function test() { const { LoginFormFactory } = ChromeUtils.import( "resource://gre/modules/LoginFormFactory.jsm" ); - const { LoginManagerContent } = ChromeUtils.import( - "resource://gre/modules/LoginManagerContent.jsm" + const { LoginManagerChild } = ChromeUtils.import( + "resource://gre/modules/LoginManagerChild.jsm" ); const { LoginHelper } = ChromeUtils.import( "resource://gre/modules/LoginHelper.jsm" @@ -75,7 +75,7 @@ add_task(async function test() { let formLike = LoginFormFactory.createFromField(password); info("Calling _fillForm with FormLike"); addedLogin = LoginHelper.vanillaObjectToLogin(addedLogin); - LoginManagerContent.forWindow(content)._fillForm( + LoginManagerChild.forWindow(content)._fillForm( formLike, [addedLogin], null, diff --git a/toolkit/components/passwordmgr/test/mochitest/test_LoginManagerContent_generatedPasswordFilledOrEdited.html b/toolkit/components/passwordmgr/test/mochitest/test_LoginManagerContent_generatedPasswordFilledOrEdited.html index f32d474d0bf2..cc9283b49658 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_LoginManagerContent_generatedPasswordFilledOrEdited.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_LoginManagerContent_generatedPasswordFilledOrEdited.html @@ -41,7 +41,7 @@ function preventDefaultAndStopProgagation(event) {