diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-03-16 22:40:26 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-16 22:40:26 +0900 |
commit | d8bbad8e1b774d6e46c7fa05324c90ce2b716a66 (patch) | |
tree | 4d4dd139b2e73bbaa5643e5b3bd6e123a6ce3e99 /src/background/controllers/ConsoleUseCase.ts | |
parent | 1f2afb8c157aa601e7cbd46041c9bf063c63d982 (diff) | |
parent | 04ebd1e5331d29b2413c174ae0fe9d73566b3b8d (diff) |
Merge pull request #1034 from ueokande/iframe-dynamic-resize
Iframe dynamic resize
Diffstat (limited to 'src/background/controllers/ConsoleUseCase.ts')
-rw-r--r-- | src/background/controllers/ConsoleUseCase.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/background/controllers/ConsoleUseCase.ts b/src/background/controllers/ConsoleUseCase.ts new file mode 100644 index 0000000..556aaf8 --- /dev/null +++ b/src/background/controllers/ConsoleUseCase.ts @@ -0,0 +1,21 @@ +import { inject, injectable } from "tsyringe"; +import ConsoleFrameClient from "./ConsoleFrameClient"; +import TabPresenter from "../presenters/TabPresenter"; + +@injectable() +export default class ConsoleUseCase { + constructor( + @inject("TabPresenter") + private readonly tabPresenter: TabPresenter, + @inject("ConsoleFrameClient") + private readonly consoleFrameClient: ConsoleFrameClient + ) {} + + async resize(width: number, height: number): Promise<void> { + const tabId = (await this.tabPresenter.getCurrent()).id; + if (typeof tabId === "undefined") { + return; + } + return this.consoleFrameClient.resize(tabId, width, height); + } +} |