diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-19 09:34:40 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-19 09:34:40 +0900 |
commit | 4be04628e19392d8da9688d538cc3374e91005d8 (patch) | |
tree | 5c2299f6b85bf96dc9df65ddd7c27aef01b0ed69 /src/content/components/top-content/index.ts | |
parent | e0c4182f14f908d13c8c814c7bc2b48a1791f881 (diff) |
Remove unused components
Diffstat (limited to 'src/content/components/top-content/index.ts')
-rw-r--r-- | src/content/components/top-content/index.ts | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/content/components/top-content/index.ts b/src/content/components/top-content/index.ts deleted file mode 100644 index 0f07653..0000000 --- a/src/content/components/top-content/index.ts +++ /dev/null @@ -1,47 +0,0 @@ -import CommonComponent from '../common'; -import FollowController from './follow-controller'; -import * as consoleFrames from '../../console-frames'; -import * as messages from '../../../shared/messages'; -import MessageListener from '../../MessageListener'; -import AddonEnabledUseCase from '../../usecases/AddonEnabledUseCase'; -import { ScrollPresenterImpl } from '../../presenters/ScrollPresenter'; - -let addonEnabledUseCase = new AddonEnabledUseCase(); -let scrollPresenter = new ScrollPresenterImpl(); - -export default class TopContent { - private win: Window; - - constructor(win: Window, store: any) { - this.win = win; - - new CommonComponent(win, store); // eslint-disable-line no-new - new FollowController(win, store); // eslint-disable-line no-new - - // TODO make component - consoleFrames.initialize(this.win.document); - - new MessageListener().onWebMessage(this.onWebMessage.bind(this)); - new MessageListener().onBackgroundMessage( - this.onBackgroundMessage.bind(this)); - } - - onWebMessage(message: messages.Message) { - switch (message.type) { - case messages.CONSOLE_UNFOCUS: - this.win.focus(); - consoleFrames.blur(window.document); - } - } - - onBackgroundMessage(message: messages.Message) { - let addonEnabled = addonEnabledUseCase.getEnabled(); - - switch (message.type) { - case messages.ADDON_ENABLED_QUERY: - return Promise.resolve(addonEnabled); - case messages.TAB_SCROLL_TO: - return scrollPresenter.scrollTo(message.x, message.y, false); - } - } -} |