From e82766c3f54f20dca5ff20cdcf9238a8cd6f5844 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Thu, 2 May 2024 17:24:18 -0500 Subject: [PATCH] [PM-5189] Refactoring implementation --- .../background/abstractions/overlay.background.ts | 4 ++-- .../src/autofill/background/overlay.background.ts | 14 ++++++++------ .../autofill-overlay-inline-menu-elements.ts | 4 ++-- .../autofill-overlay-inline-menu-elements.ts | 4 ++-- .../services/autofill-overlay-content.service.ts | 4 ++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/browser/src/autofill/background/abstractions/overlay.background.ts b/apps/browser/src/autofill/background/abstractions/overlay.background.ts index b03764e72f6..26cf214bd78 100644 --- a/apps/browser/src/autofill/background/abstractions/overlay.background.ts +++ b/apps/browser/src/autofill/background/abstractions/overlay.background.ts @@ -109,8 +109,8 @@ type OverlayBackgroundExtensionMessageHandlers = { checkIsFieldCurrentlyFocused: () => boolean; updateIsFieldCurrentlyFilling: ({ message }: BackgroundMessageParam) => void; checkIsFieldCurrentlyFilling: () => boolean; - checkIsInlineMenuButtonVisible: ({ sender }: BackgroundSenderParam) => void; - checkIsInlineMenuListVisible: ({ sender }: BackgroundSenderParam) => void; + checkIsAutofillInlineMenuButtonVisible: ({ sender }: BackgroundSenderParam) => void; + checkIsAutofillInlineMenuListVisible: ({ sender }: BackgroundSenderParam) => void; checkIsOverlayLoginCiphersPopulated: ({ sender }: BackgroundSenderParam) => void; updateSubFrameData: ({ message, sender }: BackgroundOnMessageHandlerParams) => void; rebuildSubFrameOffsets: ({ sender }: BackgroundSenderParam) => void; diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index 74d71eed123..c544da71382 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -80,8 +80,10 @@ class OverlayBackground implements OverlayBackgroundInterface { checkIsFieldCurrentlyFocused: () => this.checkIsFieldCurrentlyFocused(), updateIsFieldCurrentlyFilling: ({ message }) => this.updateIsFieldCurrentlyFilling(message), checkIsFieldCurrentlyFilling: () => this.checkIsFieldCurrentlyFilling(), - checkIsInlineMenuButtonVisible: ({ sender }) => this.checkIsInlineMenuButtonVisible(sender), - checkIsInlineMenuListVisible: ({ sender }) => this.checkIsInlineMenuListVisible(sender), + checkIsAutofillInlineMenuButtonVisible: ({ sender }) => + this.checkIsAutofillInlineMenuButtonVisible(sender), + checkIsAutofillInlineMenuListVisible: ({ sender }) => + this.checkIsAutofillInlineMenuListVisible(sender), checkIsOverlayLoginCiphersPopulated: ({ sender }) => this.checkIsOverlayLoginCiphersPopulated(sender), updateSubFrameData: ({ message, sender }) => this.updateSubFrameData(message, sender), @@ -873,18 +875,18 @@ class OverlayBackground implements OverlayBackgroundInterface { return this.isFieldCurrentlyFilling; } - private async checkIsInlineMenuButtonVisible(sender: chrome.runtime.MessageSender) { + private async checkIsAutofillInlineMenuButtonVisible(sender: chrome.runtime.MessageSender) { return await BrowserApi.tabSendMessage( sender.tab, - { command: "checkIsInlineMenuButtonVisible" }, + { command: "checkIsAutofillInlineMenuButtonVisible" }, { frameId: 0 }, ); } - private async checkIsInlineMenuListVisible(sender: chrome.runtime.MessageSender) { + private async checkIsAutofillInlineMenuListVisible(sender: chrome.runtime.MessageSender) { return await BrowserApi.tabSendMessage( sender.tab, - { command: "checkIsInlineMenuListVisible" }, + { command: "checkIsAutofillInlineMenuListVisible" }, { frameId: 0 }, ); } diff --git a/apps/browser/src/autofill/overlay/abstractions/autofill-overlay-inline-menu-elements.ts b/apps/browser/src/autofill/overlay/abstractions/autofill-overlay-inline-menu-elements.ts index 5d5d457d071..60ae1becf01 100644 --- a/apps/browser/src/autofill/overlay/abstractions/autofill-overlay-inline-menu-elements.ts +++ b/apps/browser/src/autofill/overlay/abstractions/autofill-overlay-inline-menu-elements.ts @@ -5,8 +5,8 @@ export type InlineMenuExtensionMessageHandlers = { closeInlineMenu: ({ message }: AutofillExtensionMessageParam) => void; appendInlineMenuElementsToDom: ({ message }: AutofillExtensionMessageParam) => Promise; toggleInlineMenuHidden: ({ message }: AutofillExtensionMessageParam) => void; - checkIsInlineMenuButtonVisible: () => boolean; - checkIsInlineMenuListVisible: () => boolean; + checkIsAutofillInlineMenuButtonVisible: () => boolean; + checkIsAutofillInlineMenuListVisible: () => boolean; }; export interface AutofillOverlayInlineMenuElements { diff --git a/apps/browser/src/autofill/overlay/content/autofill-overlay-inline-menu-elements.ts b/apps/browser/src/autofill/overlay/content/autofill-overlay-inline-menu-elements.ts index cec2f569948..8a7599d1c20 100644 --- a/apps/browser/src/autofill/overlay/content/autofill-overlay-inline-menu-elements.ts +++ b/apps/browser/src/autofill/overlay/content/autofill-overlay-inline-menu-elements.ts @@ -39,8 +39,8 @@ export class AutofillOverlayInlineMenuElements implements InlineMenuElementsInte appendInlineMenuElementsToDom: ({ message }) => this.appendInlineMenuElements(message), toggleInlineMenuHidden: ({ message }) => this.toggleInlineMenuHidden(message.isInlineMenuHidden), - checkIsInlineMenuButtonVisible: () => this.isInlineMenuButtonVisible(), - checkIsInlineMenuListVisible: () => this.isInlineMenuListVisible(), + checkIsAutofillInlineMenuButtonVisible: () => this.isInlineMenuButtonVisible(), + checkIsAutofillInlineMenuListVisible: () => this.isInlineMenuListVisible(), }; constructor() { diff --git a/apps/browser/src/autofill/services/autofill-overlay-content.service.ts b/apps/browser/src/autofill/services/autofill-overlay-content.service.ts index 19f5fdc2f4a..f2718bf951b 100644 --- a/apps/browser/src/autofill/services/autofill-overlay-content.service.ts +++ b/apps/browser/src/autofill/services/autofill-overlay-content.service.ts @@ -1002,11 +1002,11 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte } private async isInlineMenuButtonVisible() { - return (await this.sendExtensionMessage("checkIsInlineMenuButtonVisible")) === true; + return (await this.sendExtensionMessage("checkIsAutofillInlineMenuButtonVisible")) === true; } private async isInlineMenuListVisible() { - return (await this.sendExtensionMessage("checkIsInlineMenuListVisible")) === true; + return (await this.sendExtensionMessage("checkIsAutofillInlineMenuListVisible")) === true; } private async isInlineMenuCiphersPopulated() {