Skip to content

Commit

Permalink
Use shared instance for dependency injection
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaresiak committed Sep 18, 2024
1 parent 815243e commit 5c378b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DuckDuckGo/StubAutofillLoginImportStateProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ struct StubAutofillLoginImportStateProvider: AutofillLoginImportStateProvider {
var credentialsImportPromptPresentationCount: Int = 0

var isAutofillEnabled: Bool {
AppDependencyProvider().appSettings.autofillCredentialsEnabled
AppDependencyProvider.shared.appSettings.autofillCredentialsEnabled
}

func hasNeverPromptWebsitesFor(_ domain: String) -> Bool {
AppDependencyProvider().autofillNeverPromptWebsitesManager.hasNeverPromptWebsitesFor(domain: domain)
AppDependencyProvider.shared.autofillNeverPromptWebsitesManager.hasNeverPromptWebsitesFor(domain: domain)
}
}
4 changes: 2 additions & 2 deletions DuckDuckGo/TabManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class TabManager {
contextualOnboardingPresenter: contextualOnboardingPresenter,
contextualOnboardingLogic: contextualOnboardingLogic,
onboardingPixelReporter: onboardingPixelReporter,
featureFlagger: AppDependencyProvider().featureFlagger)
featureFlagger: AppDependencyProvider.shared.featureFlagger)
controller.applyInheritedAttribution(inheritedAttribution)
controller.attachWebView(configuration: configuration,
andLoadRequest: url == nil ? nil : URLRequest.userInitiated(url!),
Expand Down Expand Up @@ -167,7 +167,7 @@ class TabManager {
contextualOnboardingPresenter: contextualOnboardingPresenter,
contextualOnboardingLogic: contextualOnboardingLogic,
onboardingPixelReporter: onboardingPixelReporter,
featureFlagger: AppDependencyProvider().featureFlagger)
featureFlagger: AppDependencyProvider.shared.featureFlagger)
controller.attachWebView(configuration: configCopy,
andLoadRequest: request,
consumeCookies: !model.hasActiveTabs,
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/TabViewControllerLongPressMenuExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ extension TabViewController {
contextualOnboardingPresenter: contextualOnboardingPresenter,
contextualOnboardingLogic: contextualOnboardingLogic,
onboardingPixelReporter: onboardingPixelReporter,
featureFlagger: AppDependencyProvider().featureFlagger)
featureFlagger: AppDependencyProvider.shared.featureFlagger)
tabController.isLinkPreview = true
let configuration = WKWebViewConfiguration.nonPersistent()
tabController.attachWebView(configuration: configuration, andLoadRequest: URLRequest.userInitiated(url), consumeCookies: false)
Expand Down

0 comments on commit 5c378b3

Please sign in to comment.