/// <summary> /// Called after a browser has been created. When browsing cross-origin a new /// browser will be created before the old browser with the same identifier is /// destroyed. |extra_info| is a read-only value originating from /// cef_browser_host_t::cef_browser_host_create_browser(), /// cef_browser_host_t::cef_browser_host_create_browser_sync(), /// cef_life_span_handler_t::on_before_popup() or /// cef_browser_view_t::cef_browser_view_create(). /// </summary> public unsafe virtual void OnBrowserCreated(CefBrowser browser, CefDictionaryValue extraInfo) { }
/// <summary> /// Called before a keyboard event is sent to the renderer. |event| contains /// information about the keyboard event. |os_event| is the operating system /// event message, if any. Return true (1) if the event was handled or false /// (0) otherwise. If the event will be handled in on_key_event() as a keyboard /// shortcut set |is_keyboard_shortcut| to true (1) and return false (0). /// </summary> protected internal unsafe virtual bool OnPreKeyEvent(CefBrowser browser, CefKeyEvent @event, CefEventHandle osEvent, ref int isKeyboardShortcut) { return(default);
/// <summary> /// Called when a frame's address has changed. /// </summary> protected internal unsafe virtual void OnAddressChange(CefBrowser browser, CefFrame frame, string url) { }
/// <summary> /// Called when a download's status or progress information has been updated. /// This may be called multiple times before and after on_before_download(). /// Execute |callback| either asynchronously or in this function to cancel the /// download if desired. Do not keep a reference to |download_item| outside of /// this function. /// </summary> public unsafe virtual void OnDownloadUpdated(CefBrowser browser, CefDownloadItem downloadItem, CefDownloadItemCallback callback) { }
/// <summary> /// Called when the page title changes. /// </summary> protected internal unsafe virtual void OnTitleChange(CefBrowser browser, string title) { }
/// <summary> /// Called when web content in the page has toggled fullscreen mode. If /// |fullscreen| is true (1) the content will automatically be sized to fill /// the browser content area. If |fullscreen| is false (0) the content will /// automatically return to its original size and position. The client is /// responsible for resizing the browser if desired. /// </summary> protected internal unsafe virtual void OnFullscreenModeChange(CefBrowser browser, bool fullscreen) { }
protected internal virtual void OnContextReleased(CefBrowser browser, CefFrame frame, CefV8Context context) { XrayObject.OnContextReleased(context); }
protected internal unsafe override void OnDevToolsEvent(CefBrowser browser, string method, IntPtr @params, long paramsSize) { _webview.RaiseDevToolsEventAvailable(new DevToolsProtocolEventAvailableEventArgs(method, @params != IntPtr.Zero ? new string((sbyte *)@params, 0, (int)paramsSize, Encoding.UTF8) : null)); }
/// <summary> /// Called on the UI thread to allow configuration of audio stream parameters. /// Return true (1) to proceed with audio stream capture, or false (0) to /// cancel it. All members of |params| can optionally be configured here, but /// they are also pre-filled with some sensible defaults. /// </summary> protected internal unsafe virtual bool GetAudioParameters(CefBrowser browser, ref CefAudioParameters @params) { return(default);
/// <summary> /// Called on the UI thread before browser navigation. Return true (1) to /// cancel the navigation or false (0) to allow the navigation to proceed. The /// |request| object cannot be modified in this callback. /// cef_load_handler_t::OnLoadingStateChange will be called twice in all cases. /// If the navigation is allowed cef_load_handler_t::OnLoadStart and /// cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled /// cef_load_handler_t::OnLoadError will be called with an |errorCode| value of /// ERR_ABORTED. The |user_gesture| value will be true (1) if the browser /// navigated via explicit user gesture (e.g. clicking a link) or false (0) if /// it navigated automatically (e.g. via the DomContentLoaded event). /// </summary> protected internal unsafe virtual bool OnBeforeBrowse(CefBrowser browser, CefFrame frame, CefRequest request, bool userGesture, bool isRedirect) { return(default);
/// <summary> /// Called before a context menu is displayed. |params| provides information /// about the context menu state. |model| initially contains the default /// context menu. The |model| can be cleared to show no context menu or /// modified to show a custom menu. Do not keep references to |params| or /// |model| outside of this callback. /// </summary> protected internal unsafe virtual void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams @params, CefMenuModel model) { }
/// <summary> /// Called to allow custom display of the context menu. |params| provides /// information about the context menu state. |model| contains the context menu /// model resulting from OnBeforeContextMenu. For custom display return true /// (1) and execute |callback| either synchronously or asynchronously with the /// selected command ID. For default display return false (0). Do not keep /// references to |params| or |model| outside of this callback. /// </summary> protected internal unsafe virtual bool RunContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams @params, CefMenuModel model, CefRunContextMenuCallback callback) { return(default);
/// <summary> /// Return a new resource handler instance to handle the request or an NULL /// reference to allow default handling of the request. |browser| and |frame| /// will be the browser window and frame respectively that originated the /// request or NULL if the request did not originate from a browser window (for /// example, if the request came from cef_urlrequest_t). The |request| object /// passed to this function cannot be modified. /// </summary> protected internal unsafe virtual CefResourceHandler Create(CefBrowser browser, CefFrame frame, string schemeName, CefRequest request) { return(default);
/// <summary> /// Called on the IO thread before a resource request is loaded. The |browser| /// and |frame| values represent the source of the request, and may be NULL for /// requests originating from service workers or cef_urlrequest_t. To /// optionally filter cookies for the request return a /// cef_cookie_access_filter_t object. The |request| object cannot not be /// modified in this callback. /// </summary> protected internal unsafe virtual CefCookieAccessFilter GetCookieAccessFilter(CefBrowser browser, CefFrame frame, CefRequest request) { return(default);
protected internal virtual void OnFocusedNodeChanged(CefBrowser browser, CefFrame frame, CefDOMNode node) { }
/// <summary> /// Method that will be called after attempted execution of a DevTools protocol /// function. /// </summary> /// <param name="browser">The originating browser instance.</param> /// <param name="messageId">The "id" value that identifies the originating function call message.</param> /// <param name="success">true, if the function succeeded; otherwise false.</param> /// <param name="result"> /// The UTF8-encoded JSON dictionary value (which may be NULL). <paramref name="result"/> /// is only valid for the scope of this callback and should be copied if necessary.See the /// <see cref="OnDevToolsMessage"/> documentation for additional details on /// <paramref name="result"/> contents. /// </param> /// <param name="resultSize">The size of the <paramref name="result"/> buffer.</param> protected internal override void OnDevToolsMethodResult(CefBrowser browser, int messageId, bool success, IntPtr result, long resultSize) { RemoveOrAddTaskSource(messageId, null).SaveResult(messageId, success, result, (int)resultSize); }
/// <summary> /// Called after a browser has been created. When browsing cross-origin a new /// browser will be created before the old browser with the same identifier is /// destroyed. |extra_info| is a read-only value originating from /// cef_browser_host_t::cef_browser_host_create_browser(), /// cef_browser_host_t::cef_browser_host_create_browser_sync(), /// cef_life_span_handler_t::on_before_popup() or /// cef_browser_view_t::cef_browser_view_create(). /// </summary> protected internal unsafe virtual void OnBrowserCreated(CefBrowser browser, CefDictionaryValue extraInfo) { }
protected internal override bool OnDevToolsMessage(CefBrowser browser, IntPtr message, long messageSize) { return(false); }
/// <summary> /// Called before a browser is destroyed. /// </summary> protected internal unsafe virtual void OnBrowserDestroyed(CefBrowser browser) { }
/// <summary> /// Called when the page icon changes. /// </summary> protected internal unsafe virtual void OnFaviconUrlChange(CefBrowser browser, CefStringList iconUrls) { }
/// <summary> /// Called when a download's status or progress information has been updated. /// This may be called multiple times before and after on_before_download(). /// Execute |callback| either asynchronously or in this function to cancel the /// download if desired. Do not keep a reference to |download_item| outside of /// this function. /// </summary> protected internal unsafe virtual void OnDownloadUpdated(CefBrowser browser, CefDownloadItem downloadItem, CefDownloadItemCallback callback) { }
/// <summary> /// Called when the browser is about to display a tooltip. |text| contains the /// text that will be displayed in the tooltip. To handle the display of the /// tooltip yourself return true (1). Otherwise, you can optionally modify /// |text| and then return false (0) to allow the browser to display the /// tooltip. When window rendering is disabled the application is responsible /// for drawing tooltips and the return value is ignored. /// </summary> protected internal unsafe virtual bool OnTooltip(CefBrowser browser, ref string text) { return(default);
/// <summary> /// Synchronize |settings| with client state. If |get_defaults| is true (1) /// then populate |settings| with the default print settings. Do not keep a /// reference to |settings| outside of this callback. /// </summary> protected internal unsafe virtual void OnPrintSettings(CefBrowser browser, CefPrintSettings settings, bool getDefaults) { }
/// <summary> /// Called before a download begins. |suggested_name| is the suggested name for /// the download file. By default the download will be canceled. Execute /// |callback| either asynchronously or in this function to continue the /// download if desired. Do not keep a reference to |download_item| outside of /// this function. /// </summary> public unsafe virtual void OnBeforeDownload(CefBrowser browser, CefDownloadItem downloadItem, string suggestedName, CefBeforeDownloadCallback callback) { }
/// <summary> /// Show the print dialog. Execute |callback| once the dialog is dismissed. /// Return true (1) if the dialog will be displayed or false (0) to cancel the /// printing immediately. /// </summary> protected internal unsafe virtual bool OnPrintDialog(CefBrowser browser, bool hasSelection, CefPrintDialogCallback callback) { return(default);
/// <summary> /// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be /// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure /// and user-friendly display string. The |default_prompt_text| value will be /// specified for prompt dialogs only. Set |suppress_message| to true (1) and /// return false (0) to suppress the message (suppressing messages is /// preferable to immediately executing the callback as this is used to detect /// presumably malicious behavior like spamming alert messages in /// onbeforeunload). Set |suppress_message| to false (0) and return false (0) /// to use the default implementation (the default implementation will show one /// modal dialog at a time and suppress any additional dialog requests until /// the displayed dialog is dismissed). Return true (1) if the application will /// use a custom dialog or if the callback has been executed immediately. /// Custom dialogs may be either modal or modeless. If a custom dialog is used /// the application must execute |callback| once the custom dialog is /// dismissed. /// </summary> protected internal unsafe virtual bool OnJSDialog(CefBrowser browser, string originUrl, CefJSDialogType dialogType, string messageText, string defaultPromptText, CefJSDialogCallback callback, ref int suppressMessage) { return(default);
/// <summary> /// Called when printing has started for the specified |browser|. This function /// will be called before the other OnPrint*() functions and irrespective of /// how printing was initiated (e.g. cef_browser_host_t::print(), JavaScript /// window.print() or PDF extension print button). /// </summary> protected internal unsafe virtual void OnPrintStart(CefBrowser browser) { }
/// <summary> /// Called before a browser is destroyed. /// </summary> public unsafe virtual void OnBrowserDestroyed(CefBrowser browser) { }
/// <summary> /// Called on the UI thread before a new popup browser is created. The /// |browser| and |frame| values represent the source of the popup request. The /// |target_url| and |target_frame_name| values indicate where the popup /// browser should navigate and may be NULL if not specified with the request. /// The |target_disposition| value indicates where the user intended to open /// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will /// be true (1) if the popup was opened via explicit user gesture (e.g. /// clicking a link) or false (0) if the popup opened automatically (e.g. via /// the DomContentLoaded event). The |popupFeatures| structure contains /// additional information about the requested popup window. To allow creation /// of the popup browser optionally modify |windowInfo|, |client|, |settings| /// and |no_javascript_access| and return false (0). To cancel creation of the /// popup browser return true (1). The |client| and |settings| values will /// default to the source browser's values. If the |no_javascript_access| value /// is set to false (0) the new browser will not be scriptable and may not be /// hosted in the same renderer process as the source browser. Any /// modifications to |windowInfo| will be ignored if the parent browser is /// wrapped in a cef_browser_view_t. Popup browser creation will be canceled if /// the parent browser is destroyed before the popup browser creation completes /// (indicated by a call to OnAfterCreated for the popup browser). The /// |extra_info| parameter provides an opportunity to specify extra information /// specific to the created popup browser that will be passed to /// cef_render_process_handler_t::on_browser_created() in the render process. /// </summary> public unsafe virtual bool OnBeforePopup(CefBrowser browser, CefFrame frame, string targetUrl, string targetFrameName, CefWindowOpenDisposition targetDisposition, bool userGesture, CefPopupFeatures popupFeatures, CefWindowInfo windowInfo, ref CefClient client, CefBrowserSettings settings, ref CefDictionaryValue extraInfo, ref int noJavascriptAccess) { return(default);