diff --git a/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift b/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift index ee92ab847b91..96e5f9ba2263 100644 --- a/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift +++ b/ios/brave-ios/Sources/Brave/Frontend/Browser/TabManager.swift @@ -47,6 +47,7 @@ class WeakTabManagerDelegate { // TabManager must extend NSObjectProtocol in order to implement WKNavigationDelegate class TabManager: NSObject { fileprivate var delegates = [WeakTabManagerDelegate]() + fileprivate let tabEventHandlers: [TabEventHandler] weak var stateDelegate: TabManagerStateDelegate? /// Internal url to access the new tab page. @@ -130,6 +131,7 @@ class TabManager: NSObject { self.tabGeneratorAPI = tabGeneratorAPI self.historyAPI = historyAPI self.privateBrowsingManager = privateBrowsingManager + self.tabEventHandlers = TabEventHandlers.create(with: prefs) super.init() self.navDelegate.tabManager = self diff --git a/ios/brave-ios/Sources/Brave/Helpers/TabEventHandlers.swift b/ios/brave-ios/Sources/Brave/Helpers/TabEventHandlers.swift new file mode 100644 index 000000000000..0c021081fed4 --- /dev/null +++ b/ios/brave-ios/Sources/Brave/Helpers/TabEventHandlers.swift @@ -0,0 +1,17 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +import Foundation +import Shared + +class TabEventHandlers { + static func create(with prefs: Prefs) -> [TabEventHandler] { + return [ + FaviconHandler(), + UserActivityHandler(), + MetadataParserHelper(), + MediaImageLoader(prefs), + ] + } +}