in src/background/tab-context-factory.ts [49:189]
public createTabContext(
broadcastMessage: (message) => Promise<void>,
browserAdapter: BrowserAdapter,
detailsViewController: ExtensionDetailsViewController,
): TabContext {
const interpreter = new Interpreter();
const actionsHub = new ActionHub();
const storeHub = new TabContextStoreHub(actionsHub, this.visualizationConfigurationFactory);
const notificationCreator = new NotificationCreator(
browserAdapter,
this.visualizationConfigurationFactory,
this.logger,
);
const shortcutsPageController = new ShortcutsPageController(browserAdapter);
const shortcutsPageActionCreator = new ShortcutsPageActionCreator(
interpreter,
shortcutsPageController,
this.telemetryEventHandler,
this.logger,
);
const actionCreator = new ActionCreator(
interpreter,
actionsHub,
detailsViewController,
this.telemetryEventHandler,
notificationCreator,
this.visualizationConfigurationFactory,
this.targetTabController,
this.logger,
);
const detailsViewActionCreator = new DetailsViewActionCreator(
interpreter,
actionsHub.detailsViewActions,
actionsHub.sidePanelActions,
detailsViewController,
this.telemetryEventHandler,
);
const tabStopRequirementActionCreator = new TabStopRequirementActionCreator(
interpreter,
actionsHub.tabStopRequirementActions,
this.telemetryEventHandler,
);
const tabActionCreator = new TabActionCreator(
interpreter,
actionsHub.tabActions,
browserAdapter,
this.telemetryEventHandler,
this.logger,
);
const popupActionCreator = new PopupActionCreator(
interpreter,
actionsHub.tabActions,
this.telemetryEventHandler,
this.usageLogger,
);
const devToolsActionCreator = new DevToolsActionCreator(
interpreter,
actionsHub.devToolActions,
this.telemetryEventHandler,
);
const inspectActionsCreator = new InspectActionCreator(
interpreter,
actionsHub.inspectActions,
this.telemetryEventHandler,
browserAdapter,
this.logger,
);
const pathSnippetActionCreator = new PathSnippetActionCreator(
interpreter,
actionsHub.pathSnippetActions,
);
const unifiedScanResultActionCreator = new UnifiedScanResultActionCreator(
interpreter,
actionsHub.unifiedScanResultActions,
this.telemetryEventHandler,
this.notificationCreator,
);
const needsReviewScanResultActionCreator = new NeedsReviewScanResultActionCreator(
interpreter,
actionsHub.needsReviewScanResultActions,
this.telemetryEventHandler,
this.notificationCreator,
);
const contentActionCreator = new ContentActionCreator(
interpreter,
actionsHub.contentActions,
this.telemetryEventHandler,
detailsViewController,
);
const cardSelectionActionCreator = new CardSelectionActionCreator(
interpreter,
actionsHub.cardSelectionActions,
this.telemetryEventHandler,
);
const needsReviewCardSelectionActionCreator = new NeedsReviewCardSelectionActionCreator(
interpreter,
actionsHub.needsReviewCardSelectionActions,
this.telemetryEventHandler,
);
const injectionActionCreator = new InjectionActionCreator(
interpreter,
actionsHub.injectionActions,
);
const injectorController = new InjectorController(
new ContentScriptInjector(browserAdapter, this.promiseFactory, this.logger),
storeHub.visualizationStore,
interpreter,
storeHub.tabStore,
storeHub.inspectStore,
this.windowUtils,
this.logger,
);
shortcutsPageActionCreator.registerCallbacks();
actionCreator.registerCallbacks();
detailsViewActionCreator.registerCallback();
devToolsActionCreator.registerCallbacks();
inspectActionsCreator.registerCallbacks();
pathSnippetActionCreator.registerCallbacks();
tabActionCreator.registerCallbacks();
tabStopRequirementActionCreator.registerCallbacks();
popupActionCreator.registerCallbacks();
contentActionCreator.registerCallbacks();
needsReviewScanResultActionCreator.registerCallbacks();
needsReviewCardSelectionActionCreator.registerCallbacks();
unifiedScanResultActionCreator.registerCallbacks();
cardSelectionActionCreator.registerCallbacks();
injectionActionCreator.registerCallbacks();
injectorController.initialize();
const dispatcher = new StateDispatcher(broadcastMessage, storeHub, this.logger);
dispatcher.initialize();
return new TabContext(interpreter, storeHub);
}