#ifndef COREFRAME_LINUX_WEBVIEW_INTERNAL_H_
#define COREFRAME_LINUX_WEBVIEW_INTERNAL_H_

#include "plugin/coreframe_web_view_host_plugin_private.h"

void send_event(LinuxWebView *webview, FlValue *event);
void update_history(LinuxWebView *webview);
void emit_url_change(LinuxWebView *webview);
void emit_title_change(LinuxWebView *webview);
void emit_load_error(LinuxWebView *webview, GError *error,
                     const gchar *failing_url);
void use_navigation_decision(LinuxWebView *webview,
                             WebKitPolicyDecision *decision);
void evaluate_javascript(WebKitWebView *web_view, const gchar *script,
                         FlMethodCall *method_call);
gchar *build_scrollbar_style_script(LinuxWebView *webview);
gchar *build_overscroll_style_script(LinuxWebView *webview);
void rebuild_user_scripts(LinuxWebView *webview);
void console_message_received_cb(WebKitUserContentManager *manager,
                                 WebKitJavascriptResult *result,
                                 gpointer user_data);
void scroll_message_received_cb(WebKitUserContentManager *manager,
                                WebKitJavascriptResult *result,
                                gpointer user_data);
void javascript_channel_message_received_cb(WebKitUserContentManager *manager,
                                            WebKitJavascriptResult *result,
                                            gpointer user_data);
void destroy_js_channel_handler_data(gpointer data, GClosure *closure);
void instance_method_call_cb(FlMethodChannel *channel,
                             FlMethodCall *method_call, gpointer user_data);
gboolean configure_trusted_webview(LinuxWebView *webview, FlValue *args,
                                    GError **error);
FlValue *trusted_configuration(LinuxWebView *webview);
gboolean start_trusted_webview(LinuxWebView *webview);
gboolean trusted_decide_policy(LinuxWebView *webview,
                                WebKitPolicyDecision *decision,
                                WebKitPolicyDecisionType type);
void trusted_load_changed(LinuxWebView *webview, WebKitLoadEvent load_event);
gboolean trusted_load_uri(LinuxWebView *webview, const gchar *uri,
                           const gchar *navigation_kind);
gboolean complete_trusted_navigation(LinuxWebView *webview, FlValue *args);
gboolean mark_trusted_ready(LinuxWebView *webview, FlValue *args);
void trusted_dispatch(LinuxWebView *webview, FlMethodCall *method_call,
                       FlValue *args);
void capture_presentation_artifact(LinuxWebView *webview,
                                   FlMethodCall *method_call);
gboolean trusted_document_is_active(LinuxWebView *webview);
void destroy_trusted_webview_state(LinuxWebView *webview);

#endif // COREFRAME_LINUX_WEBVIEW_INTERNAL_H_
