From 21a0f2294b51f6ce78134384d34f302fb2cb8614 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 15 May 2021 18:03:43 +0900 Subject: Remove legacy find --- src/background/controllers/FindController.ts | 15 --------------- .../infrastructures/ContentMessageListener.ts | 14 -------------- src/background/repositories/FindRepository.ts | 22 ---------------------- src/background/usecases/FindUseCase.ts | 15 --------------- 4 files changed, 66 deletions(-) delete mode 100644 src/background/controllers/FindController.ts delete mode 100644 src/background/repositories/FindRepository.ts delete mode 100644 src/background/usecases/FindUseCase.ts (limited to 'src/background') diff --git a/src/background/controllers/FindController.ts b/src/background/controllers/FindController.ts deleted file mode 100644 index f3ea93f..0000000 --- a/src/background/controllers/FindController.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { injectable } from "tsyringe"; -import FindUseCase from "../usecases/FindUseCase"; - -@injectable() -export default class FindController { - constructor(private findUseCase: FindUseCase) {} - - getKeyword(): Promise { - return this.findUseCase.getKeyword(); - } - - setKeyword(keyword: string): Promise { - return this.findUseCase.setKeyword(keyword); - } -} diff --git a/src/background/infrastructures/ContentMessageListener.ts b/src/background/infrastructures/ContentMessageListener.ts index 6023047..4a6a3b8 100644 --- a/src/background/infrastructures/ContentMessageListener.ts +++ b/src/background/infrastructures/ContentMessageListener.ts @@ -3,7 +3,6 @@ import * as messages from "../../shared/messages"; import * as operations from "../../shared/operations"; import CommandController from "../controllers/CommandController"; import SettingController from "../controllers/SettingController"; -import FindController from "../controllers/FindController"; import AddonEnabledController from "../controllers/AddonEnabledController"; import LinkController from "../controllers/LinkController"; import OperationController from "../controllers/OperationController"; @@ -19,7 +18,6 @@ export default class ContentMessageListener { private readonly settingController: SettingController, private readonly commandController: CommandController, private readonly completionController: CompletionController, - private readonly findController: FindController, private readonly addonEnabledController: AddonEnabledController, private readonly linkController: LinkController, private readonly operationController: OperationController, @@ -88,10 +86,6 @@ export default class ContentMessageListener { ); case messages.SETTINGS_QUERY: return this.onSettingsQuery(); - case messages.FIND_GET_KEYWORD: - return this.onFindGetKeyword(); - case messages.FIND_SET_KEYWORD: - return this.onFindSetKeyword(message.keyword); case messages.ADDON_ENABLED_RESPONSE: return this.onAddonEnabledResponse(message.enabled); case messages.OPEN_URL: @@ -132,14 +126,6 @@ export default class ContentMessageListener { return (await this.settingController.getSetting()).toJSON(); } - onFindGetKeyword(): Promise { - return this.findController.getKeyword(); - } - - onFindSetKeyword(keyword: string): Promise { - return this.findController.setKeyword(keyword); - } - onAddonEnabledResponse(enabled: boolean): Promise { return this.addonEnabledController.indicate(enabled); } diff --git a/src/background/repositories/FindRepository.ts b/src/background/repositories/FindRepository.ts deleted file mode 100644 index 813e065..0000000 --- a/src/background/repositories/FindRepository.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { injectable } from "tsyringe"; -import MemoryStorage from "../infrastructures/MemoryStorage"; - -const FIND_KEYWORD_KEY = "find-keyword"; - -@injectable() -export default class FindRepository { - private cache: MemoryStorage; - - constructor() { - this.cache = new MemoryStorage(); - } - - getKeyword(): Promise { - return Promise.resolve(this.cache.get(FIND_KEYWORD_KEY)); - } - - setKeyword(keyword: string): Promise { - this.cache.set(FIND_KEYWORD_KEY, keyword); - return Promise.resolve(); - } -} diff --git a/src/background/usecases/FindUseCase.ts b/src/background/usecases/FindUseCase.ts deleted file mode 100644 index cc111f2..0000000 --- a/src/background/usecases/FindUseCase.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { injectable } from "tsyringe"; -import FindRepository from "../repositories/FindRepository"; - -@injectable() -export default class FindUseCase { - constructor(private readonly findRepository: FindRepository) {} - - getKeyword(): Promise { - return this.findRepository.getKeyword(); - } - - setKeyword(keyword: string): Promise { - return this.findRepository.setKeyword(keyword); - } -} -- cgit v1.2.3