_cef_jsdialog_handler_t

Struct _cef_jsdialog_handler_t 

Source
#[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_t

Base 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

Source§

fn clone(&self) -> _cef_jsdialog_handler_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_jsdialog_handler_t

Source§

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

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

impl Copy for _cef_jsdialog_handler_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.