iosWebViewFix/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserChannelDelegate...

42 lines
1.1 KiB
Swift
Raw Normal View History

2022-10-17 00:23:05 +00:00
//
// InAppBrowserChannelDelegate.swift
// flutter_inappwebview
//
// Created by Lorenzo Pichilli on 05/05/22.
//
import Foundation
import FlutterMacOS
2023-12-21 07:07:57 +00:00
public class InAppBrowserChannelDelegate: ChannelDelegate {
2022-10-17 00:23:05 +00:00
public override init(channel: FlutterMethodChannel) {
super.init(channel: channel)
}
public func onBrowserCreated() {
let arguments: [String: Any?] = [:]
channel?.invokeMethod("onBrowserCreated", arguments: arguments)
}
public func onMenuItemClicked(menuItem: InAppBrowserMenuItem) {
let arguments: [String: Any?] = [
"id": menuItem.id
]
channel?.invokeMethod("onMenuItemClicked", arguments: arguments)
}
public func onMainWindowWillClose() {
let arguments: [String: Any?] = [:]
channel?.invokeMethod("onMainWindowWillClose", arguments: arguments)
}
2022-10-17 00:23:05 +00:00
public func onExit() {
let arguments: [String: Any?] = [:]
channel?.invokeMethod("onExit", arguments: arguments)
}
deinit {
dispose()
}
}