From a26d8a8a1bed48a77e062914c120a23ace7bb8cf Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 24 Feb 2019 20:54:35 +0900 Subject: Capitalize background scripts --- src/background/usecases/LinkUseCase.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/background/usecases/LinkUseCase.js (limited to 'src/background/usecases/LinkUseCase.js') diff --git a/src/background/usecases/LinkUseCase.js b/src/background/usecases/LinkUseCase.js new file mode 100644 index 0000000..89412c5 --- /dev/null +++ b/src/background/usecases/LinkUseCase.js @@ -0,0 +1,19 @@ +import SettingRepository from '../repositories/SettingRepository'; +import TabPresenter from '../presenters/TabPresenter'; + +export default class LinkUseCase { + constructor() { + this.settingRepository = new SettingRepository(); + this.tabPresenter = new TabPresenter(); + } + + openToTab(url, tabId) { + return this.tabPresenter.open(url, tabId); + } + + openNewTab(url, openerId, background) { + return this.tabPresenter.create(url, { + openerTabId: openerId, active: !background + }); + } +} -- cgit v1.2.3