mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-26 22:01:32 +01:00
[PM-5189] Refactoring implementation
This commit is contained in:
parent
8ae427c60d
commit
e82766c3f5
@ -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;
|
||||
|
@ -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 },
|
||||
);
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ export type InlineMenuExtensionMessageHandlers = {
|
||||
closeInlineMenu: ({ message }: AutofillExtensionMessageParam) => void;
|
||||
appendInlineMenuElementsToDom: ({ message }: AutofillExtensionMessageParam) => Promise<void>;
|
||||
toggleInlineMenuHidden: ({ message }: AutofillExtensionMessageParam) => void;
|
||||
checkIsInlineMenuButtonVisible: () => boolean;
|
||||
checkIsInlineMenuListVisible: () => boolean;
|
||||
checkIsAutofillInlineMenuButtonVisible: () => boolean;
|
||||
checkIsAutofillInlineMenuListVisible: () => boolean;
|
||||
};
|
||||
|
||||
export interface AutofillOverlayInlineMenuElements {
|
||||
|
@ -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() {
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user