[PM-5189] Working through content script port improvement
This commit is contained in:
parent
f389263b64
commit
f219d71070
|
@ -99,10 +99,6 @@ export type OverlayBackgroundExtensionMessageHandlers = {
|
|||
checkIsFieldCurrentlyFilling: () => boolean;
|
||||
getAutofillInlineMenuVisibility: () => void;
|
||||
|
||||
updateAutofillInlineMenuPosition: ({
|
||||
message,
|
||||
sender,
|
||||
}: BackgroundOnMessageHandlerParams) => Promise<void>;
|
||||
toggleAutofillInlineMenuHidden: ({ message, sender }: BackgroundOnMessageHandlerParams) => void;
|
||||
checkIsAutofillInlineMenuButtonVisible: ({ sender }: BackgroundSenderParam) => void;
|
||||
checkIsAutofillInlineMenuListVisible: ({ sender }: BackgroundSenderParam) => void;
|
||||
|
@ -144,6 +140,10 @@ export type OverlayContentScriptPortMessageHandlers = {
|
|||
closeAutofillInlineMenu: ({ message, port }: PortOnMessageHandlerParams) => void;
|
||||
checkAutofillInlineMenuFocused: () => void;
|
||||
focusAutofillInlineMenuList: () => void;
|
||||
updateAutofillInlineMenuPosition: ({
|
||||
message,
|
||||
port,
|
||||
}: PortOnMessageHandlerParams) => Promise<void>;
|
||||
};
|
||||
|
||||
export type InlineMenuButtonPortMessageHandlers = {
|
||||
|
|
|
@ -82,8 +82,6 @@ export class OverlayBackground implements OverlayBackgroundInterface {
|
|||
checkIsFieldCurrentlyFilling: () => this.checkIsFieldCurrentlyFilling(),
|
||||
getAutofillInlineMenuVisibility: () => this.getInlineMenuVisibility(),
|
||||
|
||||
updateAutofillInlineMenuPosition: ({ message, sender }) =>
|
||||
this.updateInlineMenuPosition(message, sender),
|
||||
toggleAutofillInlineMenuHidden: ({ message, sender }) =>
|
||||
this.toggleInlineMenuHidden(message, sender),
|
||||
checkIsAutofillInlineMenuButtonVisible: ({ sender }) =>
|
||||
|
@ -111,6 +109,8 @@ export class OverlayBackground implements OverlayBackgroundInterface {
|
|||
closeAutofillInlineMenu: ({ message, port }) => this.closeInlineMenu(port.sender, message),
|
||||
checkAutofillInlineMenuFocused: () => this.checkInlineMenuFocused(),
|
||||
focusAutofillInlineMenuList: () => this.focusInlineMenuList(),
|
||||
updateAutofillInlineMenuPosition: ({ message, port }) =>
|
||||
this.updateInlineMenuPosition(message, port.sender),
|
||||
};
|
||||
private readonly inlineMenuButtonPortMessageHandlers: InlineMenuButtonPortMessageHandlers = {
|
||||
closeAutofillInlineMenu: ({ message, port }) => this.closeInlineMenu(port.sender, message),
|
||||
|
|
|
@ -562,7 +562,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||
* Updates the position of the inline menu button.
|
||||
*/
|
||||
private updateInlineMenuButtonPosition() {
|
||||
void this.sendExtensionMessage("updateAutofillInlineMenuPosition", {
|
||||
this.sendPortMessage("updateAutofillInlineMenuPosition", {
|
||||
overlayElement: AutofillOverlayElement.Button,
|
||||
});
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||
* Updates the position of the inline menu list.
|
||||
*/
|
||||
private updateInlineMenuListPosition() {
|
||||
void this.sendExtensionMessage("updateAutofillInlineMenuPosition", {
|
||||
this.sendPortMessage("updateAutofillInlineMenuPosition", {
|
||||
overlayElement: AutofillOverlayElement.List,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue