aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-26 16:24:14 +0900
committerGitHub <noreply@github.com>2019-05-26 16:24:14 +0900
commitcd584c8e243bafa8fc284279f716e8113607cd65 (patch)
treebc39bc30369f149e4ba4b6dc9c353b2906c4ef90 /src/content/usecases
parent07897df636ca3e732490d53fd2acf947738bf16e (diff)
parent34a96cdc9c5d7c8a11c6f1ae512fbc97724f61c4 (diff)
Merge pull request #592 from ueokande/repeat-last-operation
Add "repeat last operation" command
Diffstat (limited to 'src/content/usecases')
-rw-r--r--src/content/usecases/ClipboardUseCase.ts10
-rw-r--r--src/content/usecases/NavigateUseCase.ts8
2 files changed, 7 insertions, 11 deletions
diff --git a/src/content/usecases/ClipboardUseCase.ts b/src/content/usecases/ClipboardUseCase.ts
index 8c4d621..c8fe719 100644
--- a/src/content/usecases/ClipboardUseCase.ts
+++ b/src/content/usecases/ClipboardUseCase.ts
@@ -2,16 +2,16 @@ import { injectable, inject } from 'tsyringe';
import * as urls from '../../shared/urls';
import ClipboardRepository from '../repositories/ClipboardRepository';
import SettingRepository from '../repositories/SettingRepository';
-import TabsClient from '../client/TabsClient';
import ConsoleClient from '../client/ConsoleClient';
+import OperationClient from '../client/OperationClient';
@injectable()
export default class ClipboardUseCase {
constructor(
@inject('ClipboardRepository') private repository: ClipboardRepository,
@inject('SettingRepository') private settingRepository: SettingRepository,
- @inject('TabsClient') private client: TabsClient,
@inject('ConsoleClient') private consoleClient: ConsoleClient,
+ @inject('OperationClient') private operationClinet: OperationClient,
) {
}
@@ -26,6 +26,10 @@ export default class ClipboardUseCase {
let search = this.settingRepository.get().search;
let text = this.repository.read();
let url = urls.searchUrl(text, search);
- await this.client.openUrl(url, newTab);
+
+ // TODO: Repeat pasting from clipboard instead of opening a certain url.
+ // 'Repeat last' command is implemented in the background script and cannot
+ // access to clipboard until Firefox 63.
+ await this.operationClinet.internalOpenUrl(url, newTab);
}
}
diff --git a/src/content/usecases/NavigateUseCase.ts b/src/content/usecases/NavigateUseCase.ts
index 4711c5e..7adccfd 100644
--- a/src/content/usecases/NavigateUseCase.ts
+++ b/src/content/usecases/NavigateUseCase.ts
@@ -24,12 +24,4 @@ export default class NavigateUseCase {
openLinkNext(): void {
this.navigationPresenter.openLinkNext();
}
-
- openParent(): void {
- this.navigationPresenter.openParent();
- }
-
- openRoot(): void {
- this.navigationPresenter.openRoot();
- }
}