Skip to content

Commit

Permalink
Add delegated autofill isEnabled check and pixel params (#130)
Browse files Browse the repository at this point in the history
* Move secure vault to group

* Enable write ahead logging

* Add isEnabled delegate method

* Fix compile error

* Fix typo

* Fix tests

* Revery group changes

* Fix typo
  • Loading branch information
THISISDINOSAUR committed Aug 12, 2022
1 parent 6421174 commit 05ed8ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -35,6 +35,8 @@ public struct AutofillData {
}

public protocol SecureVaultManagerDelegate: SecureVaultErrorReporting {

func secureVaultManagerIsEnabledStatus(_: SecureVaultManager) -> Bool

func secureVaultManager(_: SecureVaultManager, promptUserToStoreAutofillData data: AutofillData)

Expand Down Expand Up @@ -75,6 +77,10 @@ extension SecureVaultManager: AutofillSecureVaultDelegate {
[SecureVaultModels.CreditCard]) -> Void) {

do {
guard let delegate = delegate, delegate.secureVaultManagerIsEnabledStatus(self) else {
completionHandler([], [], [])
return
}
let vault = try self.vault ?? SecureVaultFactory.default.makeVault(errorReporter: self.delegate)
let accounts = try vault.accountsFor(domain: domain)
let identities = try vault.identities()
Expand Down
Expand Up @@ -337,6 +337,10 @@ private class MockSecureVaultManagerDelegate: SecureVaultManagerDelegate {

private(set) var promptedAutofillData: AutofillData?

func secureVaultManagerIsEnabledStatus(_: SecureVaultManager) -> Bool {
return true
}

func secureVaultManager(_: SecureVaultManager, promptUserToStoreAutofillData data: AutofillData) {
self.promptedAutofillData = data
}
Expand Down

0 comments on commit 05ed8ae

Please sign in to comment.