aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/LinkUseCase.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/usecases/LinkUseCase.ts')
-rw-r--r--src/background/usecases/LinkUseCase.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/background/usecases/LinkUseCase.ts b/src/background/usecases/LinkUseCase.ts
new file mode 100644
index 0000000..2f4df7b
--- /dev/null
+++ b/src/background/usecases/LinkUseCase.ts
@@ -0,0 +1,19 @@
+import TabPresenter from '../presenters/TabPresenter';
+
+export default class LinkUseCase {
+ private tabPresenter: TabPresenter;
+
+ constructor() {
+ this.tabPresenter = new TabPresenter();
+ }
+
+ openToTab(url: string, tabId: number): Promise<any> {
+ return this.tabPresenter.open(url, tabId);
+ }
+
+ openNewTab(url: string, openerId: number, background: boolean): Promise<any> {
+ return this.tabPresenter.create(url, {
+ openerTabId: openerId, active: !background
+ });
+ }
+}