2018-02-19 19:07:19 +01:00
|
|
|
import { CryptoService } from '../abstractions/crypto.service';
|
|
|
|
import { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
2018-01-10 04:28:29 +01:00
|
|
|
|
|
|
|
export class ContainerService {
|
|
|
|
constructor(private cryptoService: CryptoService,
|
|
|
|
private platformUtilsService: PlatformUtilsService) {
|
|
|
|
}
|
|
|
|
|
2018-05-15 05:41:12 +02:00
|
|
|
// deprecated, use attachToGlobal instead
|
2018-01-10 04:28:29 +01:00
|
|
|
attachToWindow(win: any) {
|
2018-05-15 05:41:12 +02:00
|
|
|
this.attachToGlobal(win);
|
|
|
|
}
|
|
|
|
|
|
|
|
attachToGlobal(global: any) {
|
|
|
|
if (!global.bitwardenContainerService) {
|
|
|
|
global.bitwardenContainerService = this;
|
2018-01-10 04:28:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
getCryptoService(): CryptoService {
|
|
|
|
return this.cryptoService;
|
|
|
|
}
|
|
|
|
|
|
|
|
getPlatformUtilsService(): PlatformUtilsService {
|
|
|
|
return this.platformUtilsService;
|
|
|
|
}
|
|
|
|
}
|