diff options
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/controllers/FindController.ts | 15 | ||||
-rw-r--r-- | src/background/infrastructures/ContentMessageListener.ts | 14 | ||||
-rw-r--r-- | src/background/repositories/FindRepository.ts | 22 | ||||
-rw-r--r-- | src/background/usecases/FindUseCase.ts | 15 |
4 files changed, 0 insertions, 66 deletions
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<string> { - return this.findUseCase.getKeyword(); - } - - setKeyword(keyword: string): Promise<void> { - 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<string> { - return this.findController.getKeyword(); - } - - onFindSetKeyword(keyword: string): Promise<void> { - return this.findController.setKeyword(keyword); - } - onAddonEnabledResponse(enabled: boolean): Promise<void> { 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<string> { - return Promise.resolve(this.cache.get(FIND_KEYWORD_KEY)); - } - - setKeyword(keyword: string): Promise<void> { - 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<string> { - return this.findRepository.getKeyword(); - } - - setKeyword(keyword: string): Promise<void> { - return this.findRepository.setKeyword(keyword); - } -} |