Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delegated autofill isEnabled check and pixel params #130

Merged
merged 9 commits into from Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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