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

[iOS] Re-add tab event handlers for metadata fetch #25748

Merged
merged 1 commit into from
Oct 1, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions ios/brave-ios/Sources/Brave/Helpers/TabEventHandlers.swift
Original file line number Diff line number Diff line change
@@ -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),
]
}
}
Loading