_cef_browser_host_t

Struct _cef_browser_host_t 

Source
#[repr(C)]
pub struct _cef_browser_host_t {
Show 69 fields pub base: cef_base_ref_counted_t, pub get_browser: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_browser_t>, pub close_browser: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, force_close: c_int)>, pub try_close_browser: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub is_ready_to_be_closed: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub set_focus: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, focus: c_int)>, pub get_window_handle: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> cef_window_handle_t>, pub get_opener_window_handle: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> cef_window_handle_t>, pub get_opener_identifier: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub has_view: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub get_client: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_client_t>, pub get_request_context: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_request_context_t>, pub can_zoom: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command: cef_zoom_command_t) -> c_int>, pub zoom: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command: cef_zoom_command_t)>, pub get_default_zoom_level: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> f64>, pub get_zoom_level: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> f64>, pub set_zoom_level: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, zoomLevel: f64)>, pub run_file_dialog: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, mode: cef_file_dialog_mode_t, title: *const cef_string_t, default_file_path: *const cef_string_t, accept_filters: cef_string_list_t, callback: *mut _cef_run_file_dialog_callback_t)>, pub start_download: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, url: *const cef_string_t)>, pub download_image: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, image_url: *const cef_string_t, is_favicon: c_int, max_image_size: u32, bypass_cache: c_int, callback: *mut _cef_download_image_callback_t)>, pub print: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub print_to_pdf: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, path: *const cef_string_t, settings: *const _cef_pdf_print_settings_t, callback: *mut _cef_pdf_print_callback_t)>, pub find: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, searchText: *const cef_string_t, forward: c_int, matchCase: c_int, findNext: c_int)>, pub stop_finding: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, clearSelection: c_int)>, pub show_dev_tools: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, windowInfo: *const _cef_window_info_t, client: *mut _cef_client_t, settings: *const _cef_browser_settings_t, inspect_element_at: *const cef_point_t)>, pub close_dev_tools: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub has_dev_tools: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub send_dev_tools_message: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, message: *const c_void, message_size: usize) -> c_int>, pub execute_dev_tools_method: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, message_id: c_int, method: *const cef_string_t, params: *mut _cef_dictionary_value_t) -> c_int>, pub add_dev_tools_message_observer: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, observer: *mut _cef_dev_tools_message_observer_t) -> *mut _cef_registration_t>, pub get_navigation_entries: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, visitor: *mut _cef_navigation_entry_visitor_t, current_only: c_int)>, pub replace_misspelling: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, word: *const cef_string_t)>, pub add_word_to_dictionary: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, word: *const cef_string_t)>, pub is_window_rendering_disabled: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub was_resized: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub was_hidden: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, hidden: c_int)>, pub notify_screen_info_changed: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub invalidate: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, type_: cef_paint_element_type_t)>, pub send_external_begin_frame: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub send_key_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_key_event_t)>, pub send_mouse_click_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, type_: cef_mouse_button_type_t, mouseUp: c_int, clickCount: c_int)>, pub send_mouse_move_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, mouseLeave: c_int)>, pub send_mouse_wheel_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, deltaX: c_int, deltaY: c_int)>, pub send_touch_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_touch_event_t)>, pub send_capture_lost_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub notify_move_or_resize_started: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub get_windowless_frame_rate: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub set_windowless_frame_rate: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, frame_rate: c_int)>, pub ime_set_composition: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, text: *const cef_string_t, underlinesCount: usize, underlines: *const cef_composition_underline_t, replacement_range: *const cef_range_t, selection_range: *const cef_range_t)>, pub ime_commit_text: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, text: *const cef_string_t, replacement_range: *const cef_range_t, relative_cursor_pos: c_int)>, pub ime_finish_composing_text: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, keep_selection: c_int)>, pub ime_cancel_composition: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub drag_target_drag_enter: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, drag_data: *mut _cef_drag_data_t, event: *const cef_mouse_event_t, allowed_ops: cef_drag_operations_mask_t)>, pub drag_target_drag_over: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, allowed_ops: cef_drag_operations_mask_t)>, pub drag_target_drag_leave: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub drag_target_drop: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t)>, pub drag_source_ended_at: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, x: c_int, y: c_int, op: cef_drag_operations_mask_t)>, pub drag_source_system_drag_ended: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>, pub get_visible_navigation_entry: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_navigation_entry_t>, pub set_accessibility_state: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, accessibility_state: cef_state_t)>, pub set_auto_resize_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, enabled: c_int, min_size: *const cef_size_t, max_size: *const cef_size_t)>, pub set_audio_muted: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, mute: c_int)>, pub is_audio_muted: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub is_fullscreen: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub exit_fullscreen: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, will_cause_resize: c_int)>, pub can_execute_chrome_command: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command_id: c_int) -> c_int>, pub execute_chrome_command: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command_id: c_int, disposition: cef_window_open_disposition_t)>, pub is_render_process_unresponsive: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>, pub get_runtime_style: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> cef_runtime_style_t>,
}
Expand description

Structure used to represent the browser process aspects of a browser. The functions of this structure can only be called in the browser process. They may be called on any thread in that process unless otherwise indicated in the comments.

NOTE: This struct is allocated DLL-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§get_browser: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_browser_t>

Returns the hosted browser object.

§close_browser: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, force_close: c_int)>

Request that the browser close. Closing a browser is a multi-stage process that may complete either synchronously or asynchronously, and involves callbacks such as cef_life_span_handler_t::DoClose (Alloy style only), cef_life_span_handler_t::OnBeforeClose, and a top-level window close handler such as cef_window_delegate_t::CanClose (or platform-specific equivalent). In some cases a close request may be delayed or canceled by the user. Using try_close_browser() instead of close_browser() is recommended for most use cases. See cef_life_span_handler_t::do_close() documentation for detailed usage and examples.

If |force_close| is false (0) then JavaScript unload handlers, if any, may be fired and the close may be delayed or canceled by the user. If |force_close| is true (1) then the user will not be prompted and the close will proceed immediately (possibly asynchronously). If browser close is delayed and not canceled the default behavior is to call the top-level window close handler once the browser is ready to be closed. This default behavior can be changed for Alloy style browsers by implementing cef_life_span_handler_t::do_close(). is_ready_to_be_closed() can be used to detect mandatory browser close events when customizing close behavior on the browser process UI thread.

§try_close_browser: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Helper for closing a browser. This is similar in behavior to CLoseBrowser(false (0)) but returns a boolean to reflect the immediate close status. Call this function from a top-level window close handler such as cef_window_delegate_t::CanClose (or platform-specific equivalent) to request that the browser close, and return the result to indicate if the window close should proceed. Returns false (0) if the close will be delayed (JavaScript unload handlers triggered but still pending) or true (1) if the close will proceed immediately (possibly asynchronously). See close_browser() documentation for additional usage information. This function must be called on the browser process UI thread.

§is_ready_to_be_closed: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns true (1) if the browser is ready to be closed, meaning that the close has already been initiated and that JavaScript unload handlers have already executed or should be ignored. This can be used from a top-level window close handler such as cef_window_delegate_t::CanClose (or platform- specific equivalent) to distringuish between potentially cancelable browser close events (like the user clicking the top-level window close button before browser close has started) and mandatory browser close events (like JavaScript window.close() or after browser close has started in response to [Try]close_browser()). Not completing the browser close for mandatory close events (when this function returns true (1)) will leave the browser in a partially closed state that interferes with proper functioning. See close_browser() documentation for additional usage information. This function must be called on the browser process UI thread.

§set_focus: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, focus: c_int)>

Set whether the browser is focused.

§get_window_handle: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> cef_window_handle_t>

Retrieve the window handle (if any) for this browser. If this browser is wrapped in a cef_browser_view_t this function should be called on the browser process UI thread and it will return the handle for the top-level native window.

§get_opener_window_handle: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> cef_window_handle_t>

Retrieve the window handle (if any) of the browser that opened this browser. Will return NULL for non-popup browsers or if this browser is wrapped in a cef_browser_view_t. This function can be used in combination with custom handling of modal windows.

§get_opener_identifier: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Retrieve the unique identifier of the browser that opened this browser. Will return 0 for non-popup browsers.

§has_view: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns true (1) if this browser is wrapped in a cef_browser_view_t.

§get_client: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_client_t>

Returns the client for this browser.

§get_request_context: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_request_context_t>

Returns the request context for this browser.

§can_zoom: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command: cef_zoom_command_t) -> c_int>

Returns true (1) if this browser can execute the specified zoom command. This function can only be called on the UI thread.

§zoom: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command: cef_zoom_command_t)>

Execute a zoom command in this browser. If called on the UI thread the change will be applied immediately. Otherwise, the change will be applied asynchronously on the UI thread.

§get_default_zoom_level: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> f64>

Get the default zoom level. This value will be 0.0 by default but can be configured. This function can only be called on the UI thread.

§get_zoom_level: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> f64>

Get the current zoom level. This function can only be called on the UI thread.

§set_zoom_level: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, zoomLevel: f64)>

Change the zoom level to the specified value. Specify 0.0 to reset the zoom level to the default. If called on the UI thread the change will be applied immediately. Otherwise, the change will be applied asynchronously on the UI thread.

§run_file_dialog: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, mode: cef_file_dialog_mode_t, title: *const cef_string_t, default_file_path: *const cef_string_t, accept_filters: cef_string_list_t, callback: *mut _cef_run_file_dialog_callback_t)>

Call to run a file chooser dialog. Only a single file chooser dialog may be pending at any given time. |mode| represents the type of dialog to display. |title| to the title to be used for the dialog and may be NULL to show the default title (“Open” or “Save” depending on the mode). |default_file_path| is the path with optional directory and/or file name component that will be initially selected in the dialog. |accept_filters| are used to restrict the selectable file types and may any combination of (a) valid lower-cased MIME types (e.g. “text/” or “image/”), (b) individual file extensions (e.g. “.txt” or “.png”), or (c) combined description and file extension delimited using “|” and “;” (e.g. “Image Types|.png;.gif;.jpg”). |callback| will be executed after the dialog is dismissed or immediately if another dialog is already pending. The dialog will be initiated asynchronously on the UI thread.

§start_download: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, url: *const cef_string_t)>

Download the file at |url| using cef_download_handler_t.

§download_image: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, image_url: *const cef_string_t, is_favicon: c_int, max_image_size: u32, bypass_cache: c_int, callback: *mut _cef_download_image_callback_t)>

Download |image_url| and execute |callback| on completion with the images received from the renderer. If |is_favicon| is true (1) then cookies are not sent and not accepted during download. Images with density independent pixel (DIP) sizes larger than |max_image_size| are filtered out from the image results. Versions of the image at different scale factors may be downloaded up to the maximum scale factor supported by the system. If there are no image results <= |max_image_size| then the smallest image is resized to |max_image_size| and is the only result. A |max_image_size| of 0 means unlimited. If |bypass_cache| is true (1) then |image_url| is requested from the server even if it is present in the browser cache.

§print: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Print the current browser contents.

§print_to_pdf: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, path: *const cef_string_t, settings: *const _cef_pdf_print_settings_t, callback: *mut _cef_pdf_print_callback_t)>

Print the current browser contents to the PDF file specified by |path| and execute |callback| on completion. The caller is responsible for deleting |path| when done. For PDF printing to work on Linux you must implement the cef_print_handler_t::GetPdfPaperSize function.

§find: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, searchText: *const cef_string_t, forward: c_int, matchCase: c_int, findNext: c_int)>

Search for |searchText|. |forward| indicates whether to search forward or backward within the page. |matchCase| indicates whether the search should be case-sensitive. |findNext| indicates whether this is the first request or a follow-up. The search will be restarted if |searchText| or |matchCase| change. The search will be stopped if |searchText| is NULL. The cef_find_handler_t instance, if any, returned via cef_client_t::GetFindHandler will be called to report find results.

§stop_finding: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, clearSelection: c_int)>

Cancel all searches that are currently going on.

§show_dev_tools: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, windowInfo: *const _cef_window_info_t, client: *mut _cef_client_t, settings: *const _cef_browser_settings_t, inspect_element_at: *const cef_point_t)>

Open developer tools (DevTools) in its own browser. The DevTools browser will remain associated with this browser. If the DevTools browser is already open then it will be focused, in which case the |windowInfo|, |client| and |settings| parameters will be ignored. If |inspect_element_at| is non-NULL then the element at the specified (x,y) location will be inspected. The |windowInfo| parameter will be ignored if this browser is wrapped in a cef_browser_view_t.

§close_dev_tools: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Explicitly close the associated DevTools browser, if any.

§has_dev_tools: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns true (1) if this browser currently has an associated DevTools browser. Must be called on the browser process UI thread.

§send_dev_tools_message: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, message: *const c_void, message_size: usize) -> c_int>

Send a function call message over the DevTools protocol. |message| must be a UTF8-encoded JSON dictionary that contains “id” (int), “function” (string) and “params” (dictionary, optional) values. See the DevTools protocol documentation at https://chromedevtools.github.io/devtools- protocol/ for details of supported functions and the expected “params” dictionary contents. |message| will be copied if necessary. This function will return true (1) if called on the UI thread and the message was successfully submitted for validation, otherwise false (0). Validation will be applied asynchronously and any messages that fail due to formatting errors or missing parameters may be discarded without notification. Prefer ExecuteDevToolsMethod if a more structured approach to message formatting is desired.

Every valid function call will result in an asynchronous function result or error message that references the sent message “id”. Event messages are received while notifications are enabled (for example, between function calls for “Page.enable” and “Page.disable”). All received messages will be delivered to the observer(s) registered with AddDevToolsMessageObserver. See cef_dev_tools_message_observer_t::OnDevToolsMessage documentation for details of received message contents.

Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and AddDevToolsMessageObserver functions does not require an active DevTools front-end or remote-debugging session. Other active DevTools sessions will continue to function independently. However, any modification of global browser state by one session may not be reflected in the UI of other sessions.

Communication with the DevTools front-end (when displayed) can be logged for development purposes by passing the --devtools-protocol-log- file=<path> command-line flag.

§execute_dev_tools_method: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, message_id: c_int, method: *const cef_string_t, params: *mut _cef_dictionary_value_t) -> c_int>

Execute a function call over the DevTools protocol. This is a more structured version of SendDevToolsMessage. |message_id| is an incremental number that uniquely identifies the message (pass 0 to have the next number assigned automatically based on previous values). |function| is the function name. |params| are the function parameters, which may be NULL. See the DevTools protocol documentation (linked above) for details of supported functions and the expected |params| dictionary contents. This function will return the assigned message ID if called on the UI thread and the message was successfully submitted for validation, otherwise 0. See the SendDevToolsMessage documentation for additional usage information.

§add_dev_tools_message_observer: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, observer: *mut _cef_dev_tools_message_observer_t) -> *mut _cef_registration_t>

Add an observer for DevTools protocol messages (function results and events). The observer will remain registered until the returned Registration object is destroyed. See the SendDevToolsMessage documentation for additional usage information.

§get_navigation_entries: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, visitor: *mut _cef_navigation_entry_visitor_t, current_only: c_int)>

Retrieve a snapshot of current navigation entries as values sent to the specified visitor. If |current_only| is true (1) only the current navigation entry will be sent, otherwise all navigation entries will be sent.

§replace_misspelling: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, word: *const cef_string_t)>

If a misspelled word is currently selected in an editable node calling this function will replace it with the specified |word|.

§add_word_to_dictionary: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, word: *const cef_string_t)>

Add the specified |word| to the spelling dictionary.

§is_window_rendering_disabled: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns true (1) if window rendering is disabled.

§was_resized: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Notify the browser that the widget has been resized. The browser will first call cef_render_handler_t::GetViewRect to get the new size and then call cef_render_handler_t::OnPaint asynchronously with the updated regions. This function is only used when window rendering is disabled.

§was_hidden: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, hidden: c_int)>

Notify the browser that it has been hidden or shown. Layouting and cef_render_handler_t::OnPaint notification will stop when the browser is hidden. This function is only used when window rendering is disabled.

§notify_screen_info_changed: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Notify the browser that screen information has changed. Updated information will be sent to the renderer process to configure screen size and position values used by CSS and JavaScript (window.deviceScaleFactor, window.screenX/Y, window.outerWidth/Height, etc.). For background see https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage.md#markdown- header-coordinate-systems

This function is used with (a) windowless rendering and (b) windowed rendering with external (client-provided) root window.

With windowless rendering the browser will call cef_render_handler_t::GetScreenInfo, cef_render_handler_t::GetRootScreenRect and cef_render_handler_t::GetViewRect. This simulates moving or resizing the root window in the current display, moving the root window from one display to another, or changing the properties of the current display.

With windowed rendering the browser will call cef_display_handler_t::GetRootWindowScreenRect and use the associated display properties.

§invalidate: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, type_: cef_paint_element_type_t)>

Invalidate the view. The browser will call cef_render_handler_t::OnPaint asynchronously. This function is only used when window rendering is disabled.

§send_external_begin_frame: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Issue a BeginFrame request to Chromium. Only valid when cef_window_tInfo::external_begin_frame_enabled is set to true (1).

§send_key_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_key_event_t)>

Send a key event to the browser.

§send_mouse_click_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, type_: cef_mouse_button_type_t, mouseUp: c_int, clickCount: c_int)>

Send a mouse click event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view.

§send_mouse_move_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, mouseLeave: c_int)>

Send a mouse move event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view.

§send_mouse_wheel_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, deltaX: c_int, deltaY: c_int)>

Send a mouse wheel event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view. The |deltaX| and |deltaY| values represent the movement delta in the X and Y directions respectively. In order to scroll inside select popups with window rendering disabled cef_render_handler_t::GetScreenPoint should be implemented properly.

§send_touch_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_touch_event_t)>

Send a touch event to the browser for a windowless browser.

§send_capture_lost_event: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Send a capture lost event to the browser.

§notify_move_or_resize_started: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Notify the browser that the window hosting it is about to be moved or resized. This function is only used on Windows and Linux.

§get_windowless_frame_rate: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns the maximum rate in frames per second (fps) that cef_render_handler_t::OnPaint will be called for a windowless browser. The actual fps may be lower if the browser cannot generate frames at the requested rate. The minimum value is 1 and the maximum value is 60 (default 30). This function can only be called on the UI thread.

§set_windowless_frame_rate: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, frame_rate: c_int)>

Set the maximum rate in frames per second (fps) that cef_render_handler_t:: OnPaint will be called for a windowless browser. The actual fps may be lower if the browser cannot generate frames at the requested rate. The minimum value is 1 and the maximum value is 60 (default 30). Can also be set at browser creation via cef_browser_tSettings.windowless_frame_rate.

§ime_set_composition: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, text: *const cef_string_t, underlinesCount: usize, underlines: *const cef_composition_underline_t, replacement_range: *const cef_range_t, selection_range: *const cef_range_t)>

Begins a new composition or updates the existing composition. Blink has a special node (a composition node) that allows the input function to change text without affecting other DOM nodes. |text| is the optional text that will be inserted into the composition node. |underlines| is an optional set of ranges that will be underlined in the resulting text. |replacement_range| is an optional range of the existing text that will be replaced. |selection_range| is an optional range of the resulting text that will be selected after insertion or replacement. The |replacement_range| value is only used on OS X.

This function may be called multiple times as the composition changes. When the client is done making changes the composition should either be canceled or completed. To cancel the composition call ImeCancelComposition. To complete the composition call either ImeCommitText or ImeFinishComposingText. Completion is usually signaled when:

  1. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR flag (on Windows), or;
  2. The client receives a “commit” signal of GtkIMContext (on Linux), or;
  3. insertText of NSTextInput is called (on Mac).

This function is only used when window rendering is disabled.

§ime_commit_text: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, text: *const cef_string_t, replacement_range: *const cef_range_t, relative_cursor_pos: c_int)>

Completes the existing composition by optionally inserting the specified |text| into the composition node. |replacement_range| is an optional range of the existing text that will be replaced. |relative_cursor_pos| is where the cursor will be positioned relative to the current cursor position. See comments on ImeSetComposition for usage. The |replacement_range| and |relative_cursor_pos| values are only used on OS X. This function is only used when window rendering is disabled.

§ime_finish_composing_text: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, keep_selection: c_int)>

Completes the existing composition by applying the current composition node contents. If |keep_selection| is false (0) the current selection, if any, will be discarded. See comments on ImeSetComposition for usage. This function is only used when window rendering is disabled.

§ime_cancel_composition: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Cancels the existing composition and discards the composition node contents without applying them. See comments on ImeSetComposition for usage. This function is only used when window rendering is disabled.

§drag_target_drag_enter: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, drag_data: *mut _cef_drag_data_t, event: *const cef_mouse_event_t, allowed_ops: cef_drag_operations_mask_t)>

Call this function when the user drags the mouse into the web view (before calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data| should not contain file contents as this type of data is not allowed to be dragged into the web view. File contents can be removed using cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from cef_render_handler_t::StartDragging). This function is only used when window rendering is disabled.

§drag_target_drag_over: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t, allowed_ops: cef_drag_operations_mask_t)>

Call this function each time the mouse is moved across the web view during a drag operation (after calling DragTargetDragEnter and before calling DragTargetDragLeave/DragTargetDrop). This function is only used when window rendering is disabled.

§drag_target_drag_leave: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Call this function when the user drags the mouse out of the web view (after calling DragTargetDragEnter). This function is only used when window rendering is disabled.

§drag_target_drop: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, event: *const cef_mouse_event_t)>

Call this function when the user completes the drag operation by dropping the object onto the web view (after calling DragTargetDragEnter). The object being dropped is |drag_data|, given as an argument to the previous DragTargetDragEnter call. This function is only used when window rendering is disabled.

§drag_source_ended_at: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, x: c_int, y: c_int, op: cef_drag_operations_mask_t)>

Call this function when the drag operation started by a cef_render_handler_t::StartDragging call has ended either in a drop or by being cancelled. |x| and |y| are mouse coordinates relative to the upper- left corner of the view. If the web view is both the drag source and the drag target then all DragTarget* functions should be called before DragSource* mthods. This function is only used when window rendering is disabled.

§drag_source_system_drag_ended: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t)>

Call this function when the drag operation started by a cef_render_handler_t::StartDragging call has completed. This function may be called immediately without first calling DragSourceEndedAt to cancel a drag operation. If the web view is both the drag source and the drag target then all DragTarget* functions should be called before DragSource* mthods. This function is only used when window rendering is disabled.

§get_visible_navigation_entry: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> *mut _cef_navigation_entry_t>

Returns the current visible navigation entry for this browser. This function can only be called on the UI thread.

§set_accessibility_state: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, accessibility_state: cef_state_t)>

Set accessibility state for all frames. |accessibility_state| may be default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT then accessibility will be disabled by default and the state may be further controlled with the “force-renderer-accessibility” and “disable- renderer-accessibility” command-line switches. If |accessibility_state| is STATE_ENABLED then accessibility will be enabled. If |accessibility_state| is STATE_DISABLED then accessibility will be completely disabled.

For windowed browsers accessibility will be enabled in Complete mode (which corresponds to kAccessibilityModeComplete in Chromium). In this mode all platform accessibility objects will be created and managed by Chromium’s internal implementation. The client needs only to detect the screen reader and call this function appropriately. For example, on macOS the client can handle the @“AXEnhancedUserStructure” accessibility attribute to detect VoiceOver state changes and on Windows the client can handle WM_GETOBJECT with OBJID_CLIENT to detect accessibility readers.

For windowless browsers accessibility will be enabled in TreeOnly mode (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In this mode renderer accessibility is enabled, the full tree is computed, and events are passed to CefAccessibiltyHandler, but platform accessibility objects are not created. The client may implement platform accessibility objects using CefAccessibiltyHandler callbacks if desired.

§set_auto_resize_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, enabled: c_int, min_size: *const cef_size_t, max_size: *const cef_size_t)>

Enable notifications of auto resize via cef_display_handler_t::OnAutoResize. Notifications are disabled by default. |min_size| and |max_size| define the range of allowed sizes.

§set_audio_muted: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, mute: c_int)>

Set whether the browser’s audio is muted.

§is_audio_muted: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns true (1) if the browser’s audio is muted. This function can only be called on the UI thread.

§is_fullscreen: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns true (1) if the renderer is currently in browser fullscreen. This differs from window fullscreen in that browser fullscreen is entered using the JavaScript Fullscreen API and modifies CSS attributes such as the ::backdrop pseudo-element and :fullscreen pseudo-structure. This function can only be called on the UI thread.

§exit_fullscreen: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, will_cause_resize: c_int)>

Requests the renderer to exit browser fullscreen. In most cases exiting window fullscreen should also exit browser fullscreen. With Alloy style this function should be called in response to a user action such as clicking the green traffic light button on MacOS (cef_window_delegate_t::OnWindowFullscreenTransition callback) or pressing the “ESC” key (cef_keyboard_handler_t::OnPreKeyEvent callback). With Chrome style these standard exit actions are handled internally but new/additional user actions can use this function. Set |will_cause_resize| to true (1) if exiting browser fullscreen will cause a view resize.

§can_execute_chrome_command: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command_id: c_int) -> c_int>

Returns true (1) if a Chrome command is supported and enabled. Use the cef_id_for_command_id_name() function for version-safe mapping of command IDC names from cef_command_ids.h to version-specific numerical |command_id| values. This function can only be called on the UI thread. Only used with Chrome style.

§execute_chrome_command: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t, command_id: c_int, disposition: cef_window_open_disposition_t)>

Execute a Chrome command. Use the cef_id_for_command_id_name() function for version-safe mapping of command IDC names from cef_command_ids.h to version-specific numerical |command_id| values. |disposition| provides information about the intended command target. Only used with Chrome style.

§is_render_process_unresponsive: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> c_int>

Returns true (1) if the render process associated with this browser is currently unresponsive as indicated by a lack of input event processing for at least 15 seconds. To receive associated state change notifications and optionally handle an unresponsive render process implement cef_request_handler_t::OnRenderProcessUnresponsive. This function can only be called on the UI thread.

§get_runtime_style: Option<unsafe extern "C" fn(self_: *mut _cef_browser_host_t) -> cef_runtime_style_t>

Returns the runtime style for this browser (ALLOY or CHROME). See cef_runtime_style_t documentation for details.

Trait Implementations§

Source§

impl Clone for _cef_browser_host_t

Source§

fn clone(&self) -> _cef_browser_host_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _cef_browser_host_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for _cef_browser_host_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.