Skip to content

Commit

Permalink
Update references in TabViewController
Browse files Browse the repository at this point in the history
  • Loading branch information
afterxleep committed Aug 7, 2024
1 parent 91b0722 commit cd353e2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo/DuckPlayer/DuckNavigationHandling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import WebKit

protocol DuckNavigationHandling {
protocol DuckNavigationHandling: AnyObject {
var referrer: DuckPlayerReferrer { get set }
var duckPlayer: DuckPlayerProtocol { get }
func handleNavigation(_ navigationAction: WKNavigationAction, webView: WKWebView)
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/DuckPlayer/DuckPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public enum DuckPlayerReferrer {
case youtube, other
}

protocol DuckPlayerProtocol {
protocol DuckPlayerProtocol: AnyObject {

var settings: DuckPlayerSettingsProtocol { get }
var hostView: UIViewController? { get }
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/DuckPlayer/DuckPlayerSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enum DuckPlayerMode: Equatable, Codable, CustomStringConvertible, CaseIterable {
}
}

protocol DuckPlayerSettingsProtocol {
protocol DuckPlayerSettingsProtocol: AnyObject {

var duckPlayerSettingsPublisher: AnyPublisher<Void, Never> { get }
var mode: DuckPlayerMode { get }
Expand Down
10 changes: 6 additions & 4 deletions DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class TabViewController: UIViewController {
bookmarksDatabase: CoreDataDatabase,
historyManager: HistoryManaging,
syncService: DDGSyncing,
duckPlayer: DuckPlayerProtocol,
duckPlayer: DuckPlayerProtocol?,
privacyProDataReporter: PrivacyProDataReporting,
contextualOnboardingPresenter: ContextualOnboardingPresenting,
contextualOnboardingLogic: ContextualOnboardingLogic,
Expand Down Expand Up @@ -323,7 +323,7 @@ class TabViewController: UIViewController {

let historyManager: HistoryManaging
let historyCapture: HistoryCapture
var duckPlayer: DuckPlayerProtocol
weak var duckPlayer: DuckPlayerProtocol?
var duckPlayerNavigationHandler: DuckNavigationHandling?

let contextualOnboardingPresenter: ContextualOnboardingPresenting
Expand All @@ -336,7 +336,7 @@ class TabViewController: UIViewController {
bookmarksDatabase: CoreDataDatabase,
historyManager: HistoryManaging,
syncService: DDGSyncing,
duckPlayer: DuckPlayerProtocol,
duckPlayer: DuckPlayerProtocol?,
privacyProDataReporter: PrivacyProDataReporting,
contextualOnboardingPresenter: ContextualOnboardingPresenting,
contextualOnboardingLogic: ContextualOnboardingLogic,
Expand All @@ -348,7 +348,9 @@ class TabViewController: UIViewController {
self.historyCapture = HistoryCapture(historyManager: historyManager)
self.syncService = syncService
self.duckPlayer = duckPlayer
self.duckPlayerNavigationHandler = DuckPlayerNavigationHandler(duckPlayer: duckPlayer)
if let duckPlayer {
self.duckPlayerNavigationHandler = DuckPlayerNavigationHandler(duckPlayer: duckPlayer)
}
self.privacyProDataReporter = privacyProDataReporter
self.contextualOnboardingPresenter = contextualOnboardingPresenter
self.contextualOnboardingLogic = contextualOnboardingLogic
Expand Down

0 comments on commit cd353e2

Please sign in to comment.