aboutsummaryrefslogtreecommitdiff
path: root/src/content/controllers/FollowSlaveController.ts
blob: 88dccf3f2614323aa71d858f320c7a99e90c7c30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import * as messages from '../../shared/messages';
import FollowSlaveUseCase from '../usecases/FollowSlaveUseCase';

export default class FollowSlaveController {
  private usecase: FollowSlaveUseCase;

  constructor({
    usecase = new FollowSlaveUseCase(),
  } = {}) {
    this.usecase = usecase;
  }

  countTargets(m: messages.FollowRequestCountTargetsMessage): void {
    this.usecase.countTargets(m.viewSize, m.framePosition);
  }

  createHints(m: messages.FollowCreateHintsMessage): void {
    this.usecase.createHints(m.viewSize, m.framePosition, m.tags);
  }

  showHints(m: messages.FollowShowHintsMessage): void {
    this.usecase.showHints(m.prefix);
  }

  activate(m: messages.FollowActivateMessage): void {
    this.usecase.activate(m.tag, m.newTab, m.background);
  }

  clear(_m: messages.FollowRemoveHintsMessage) {
    this.usecase.clear();
  }
}