From a1e5e97200bd96ba918744dfa2758f977ca823c6 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 22 Jul 2018 00:01:24 +0900 Subject: Find as clean architecture --- src/background/infrastructures/content-message-listener.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/background/infrastructures') diff --git a/src/background/infrastructures/content-message-listener.js b/src/background/infrastructures/content-message-listener.js index 6236f1c..00dba51 100644 --- a/src/background/infrastructures/content-message-listener.js +++ b/src/background/infrastructures/content-message-listener.js @@ -1,11 +1,13 @@ import messages from '../../shared/messages'; import CompletionsController from '../controllers/completions'; import SettingController from '../controllers/setting'; +import FindController from '../controllers/find'; export default class ContentMessageListener { constructor() { this.settingController = new SettingController(); this.completionsController = new CompletionsController(); + this.findController = new FindController(); } run() { @@ -29,6 +31,10 @@ export default class ContentMessageListener { return this.onSettingsQuery(); case messages.SETTINGS_RELOAD: return this.onSettingsReload(); + case messages.FIND_GET_KEYWORD: + return this.onFindGetKeyword(); + case messages.FIND_SET_KEYWORD: + return this.onFindSetKeyword(message.keyword); } } @@ -44,4 +50,12 @@ export default class ContentMessageListener { onSettingsReload() { return this.settingController.reload(); } + + onFindGetKeyword() { + return this.findController.getKeyword(); + } + + onFindSetKeyword(keyword) { + return this.findController.setKeyword(keyword); + } } -- cgit v1.2.3