log event when copying password from context menu

This commit is contained in:
Kyle Spearrin 2019-07-12 15:16:06 -04:00
parent 6263a11463
commit 2c6b3927d4
1 changed files with 5 additions and 1 deletions

View File

@ -5,16 +5,19 @@ import MainBackground from './main.background';
import { Analytics } from 'jslib/misc';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { EventService } from 'jslib/abstractions/event.service';
import { LockService } from 'jslib/abstractions/lock.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { EventType } from 'jslib/enums/eventType';
export default class ContextMenusBackground {
private contextMenus: any;
constructor(private main: MainBackground, private cipherService: CipherService,
private passwordGenerationService: PasswordGenerationService, private analytics: Analytics,
private platformUtilsService: PlatformUtilsService, private lockService: LockService) {
private platformUtilsService: PlatformUtilsService, private lockService: LockService,
private eventService: EventService) {
this.contextMenus = chrome.contextMenus;
}
@ -86,6 +89,7 @@ export default class ContextMenusBackground {
eventAction: 'Copied Password From Context Menu',
});
this.platformUtilsService.copyToClipboard(cipher.login.password, { window: window });
this.eventService.collect(EventType.Cipher_ClientCopiedPassword, cipher.id);
}
}