#[repr(C)]pub struct _cef_jsdialog_handler_t {
pub base: cef_base_ref_counted_t,
pub on_jsdialog: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t, origin_url: *const cef_string_t, dialog_type: cef_jsdialog_type_t, message_text: *const cef_string_t, default_prompt_text: *const cef_string_t, callback: *mut _cef_jsdialog_callback_t, suppress_message: *mut c_int) -> c_int>,
pub on_before_unload_dialog: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t, message_text: *const cef_string_t, is_reload: c_int, callback: *mut _cef_jsdialog_callback_t) -> c_int>,
pub on_reset_dialog_state: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t)>,
pub on_dialog_closed: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t)>,
}Expand description
Implement this structure to handle events related to JavaScript dialogs. The functions of this structure will be called on the UI thread.
NOTE: This struct is allocated client-side.
Fields§
§base: cef_base_ref_counted_tBase structure.
on_jsdialog: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t, origin_url: *const cef_string_t, dialog_type: cef_jsdialog_type_t, message_text: *const cef_string_t, default_prompt_text: *const cef_string_t, callback: *mut _cef_jsdialog_callback_t, suppress_message: *mut c_int) -> c_int>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.
on_before_unload_dialog: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t, message_text: *const cef_string_t, is_reload: c_int, callback: *mut _cef_jsdialog_callback_t) -> c_int>Called to run a dialog asking the user if they want to leave a page. Return false (0) to use the default dialog implementation. 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.
on_reset_dialog_state: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t)>Called to cancel any pending dialogs and reset any saved dialog state. Will be called due to events like page navigation irregardless of whether any dialogs are currently pending.
on_dialog_closed: Option<unsafe extern "C" fn(self_: *mut _cef_jsdialog_handler_t, browser: *mut _cef_browser_t)>Called when the dialog is closed.
Trait Implementations§
Source§impl Clone for _cef_jsdialog_handler_t
impl Clone for _cef_jsdialog_handler_t
Source§fn clone(&self) -> _cef_jsdialog_handler_t
fn clone(&self) -> _cef_jsdialog_handler_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more