diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-28 10:42:32 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-28 10:42:32 +0900 |
commit | 66c23423f931bb66c59cd29cf9279a5de5d56535 (patch) | |
tree | 5c2b37cea2e93aa949d88bf12ac97c294aff2335 /src/background/infrastructures/content-message-listener.js | |
parent | ab29706348ec9091d1d75c0418f24dfab849a2e5 (diff) |
Background operation as Clean Architecture
Diffstat (limited to 'src/background/infrastructures/content-message-listener.js')
-rw-r--r-- | src/background/infrastructures/content-message-listener.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/background/infrastructures/content-message-listener.js b/src/background/infrastructures/content-message-listener.js index 2e84fcc..277d108 100644 --- a/src/background/infrastructures/content-message-listener.js +++ b/src/background/infrastructures/content-message-listener.js @@ -4,6 +4,7 @@ import SettingController from '../controllers/setting'; import FindController from '../controllers/find'; import AddonEnabledController from '../controllers/addon-enabled'; import LinkController from '../controllers/link'; +import OperationController from '../controllers/operation'; export default class ContentMessageListener { constructor() { @@ -12,6 +13,7 @@ export default class ContentMessageListener { this.findController = new FindController(); this.addonEnabledController = new AddonEnabledController(); this.linkController = new LinkController(); + this.backgroundOperationController = new OperationController(); } run() { @@ -46,6 +48,8 @@ export default class ContentMessageListener { case messages.OPEN_URL: return this.onOpenUrl( message.newTab, message.url, sender.tab.id, message.background); + case messages.BACKGROUND_OPERATION: + return this.onBackgroundOperation(message.operation); } } @@ -85,4 +89,8 @@ export default class ContentMessageListener { } return this.linkController.openToTab(url, openerId); } + + onBackgroundOperation(operation) { + return this.backgroundOperationController.exec(operation); + } } |