use crate::webview::action::{NavigationAction, NavigationPolicy, NavigationResponse, NavigationResponsePolicy, OpenPanelParameters}; pub trait WebViewController { fn on_message(&self, name: &str, body: &str) {} fn policy_for_navigation_action(&self, action: NavigationAction, handler: F) { handler(NavigationPolicy::Allow); } fn policy_for_navigation_response(&self, response: NavigationResponse, handler: F) { handler(NavigationResponsePolicy::Allow); } fn run_open_panel>) + 'static>(&self, parameters: OpenPanelParameters, handler: F) { handler(None); } fn run_save_panel) + 'static>(&self, suggested_filename: &str, handler: F) { handler(false, None); } }