1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Refactor for barrels. Utils service to jslib

This commit is contained in:
Kyle Spearrin
2018-01-06 22:13:48 -05:00
parent c018f096b4
commit 03258e50f7
56 changed files with 270 additions and 433 deletions

View File

@@ -1,4 +1,4 @@
import { CipherType } from '@bitwarden/jslib';
import { Abstractions, Enums, Services } from '@bitwarden/jslib';
import BrowserApi from '../browser/browserApi';
@@ -6,9 +6,6 @@ import MainBackground from './main.background';
import AutofillService from '../services/autofill.service';
import CipherService from '../services/cipher.service';
import UtilsService from '../services/utils.service';
import { PlatformUtilsService } from '@bitwarden/jslib';
export default class RuntimeBackground {
private runtime: any;
@@ -16,7 +13,7 @@ export default class RuntimeBackground {
private pageDetailsToAutoFill: any[] = [];
constructor(private main: MainBackground, private autofillService: AutofillService,
private cipherService: CipherService, private platformUtilsService: PlatformUtilsService) {
private cipherService: CipherService, private platformUtilsService: Abstractions.PlatformUtilsService) {
this.runtime = chrome.runtime;
}
@@ -149,7 +146,7 @@ export default class RuntimeBackground {
favorite: false,
name: loginInfo.name,
notes: null,
type: CipherType.Login,
type: Enums.CipherType.Login,
login: {
uri: loginInfo.uri,
username: loginInfo.username,
@@ -180,7 +177,7 @@ export default class RuntimeBackground {
}
this.main.loginsToAdd.splice(i, 1);
const hostname = UtilsService.getHostname(tab.url);
const hostname = Services.UtilsService.getHostname(tab.url);
await this.cipherService.saveNeverDomain(hostname);
BrowserApi.tabSendMessage(tab, 'closeNotificationBar');
}