From 6d9aaef18c9f48684c8bb99e53c586e9781a69f0 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 19 May 2019 15:36:14 +0900 Subject: Add NavigationPresenter --- src/content/usecases/FocusUseCase.ts | 1 + src/content/usecases/NavigateUseCase.ts | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'src/content/usecases') diff --git a/src/content/usecases/FocusUseCase.ts b/src/content/usecases/FocusUseCase.ts index 615442d..0ad4021 100644 --- a/src/content/usecases/FocusUseCase.ts +++ b/src/content/usecases/FocusUseCase.ts @@ -1,5 +1,6 @@ import FocusPresenter, { FocusPresenterImpl } from '../presenters/FocusPresenter'; + export default class FocusUseCases { private presenter: FocusPresenter; diff --git a/src/content/usecases/NavigateUseCase.ts b/src/content/usecases/NavigateUseCase.ts index f790212..6f82d3f 100644 --- a/src/content/usecases/NavigateUseCase.ts +++ b/src/content/usecases/NavigateUseCase.ts @@ -1,27 +1,36 @@ -import * as navigates from '../navigates'; +import NavigationPresenter, { NavigationPresenterImpl } + from '../presenters/NavigationPresenter'; + +export default class NavigateUseCase { + private navigationPresenter: NavigationPresenter; + + constructor({ + navigationPresenter = new NavigationPresenterImpl(), + } = {}) { + this.navigationPresenter = navigationPresenter; + } -export default class NavigateClass { openHistoryPrev(): void { - navigates.historyPrev(window); + this.navigationPresenter.openHistoryPrev(); } openHistoryNext(): void { - navigates.historyNext(window); + this.navigationPresenter.openHistoryNext(); } openLinkPrev(): void { - navigates.linkPrev(window); + this.navigationPresenter.openLinkPrev(); } openLinkNext(): void { - navigates.linkNext(window); + this.navigationPresenter.openLinkNext(); } openParent(): void { - navigates.parent(window); + this.navigationPresenter.openParent(); } openRoot(): void { - navigates.root(window); + this.navigationPresenter.openRoot(); } } -- cgit v1.2.3