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