cef_download_handler_t

Structure used to handle file downloads. The functions of this structure will called on the browser process UI thread.

Members

Variables

base
cef_base_ref_counted_t base;

Base structure.

can_download
int function(cef_download_handler_t* self, cef_browser_t* browser, const(cef_string_t)* url, const(cef_string_t)* request_method) nothrow can_download;

Called before a download begins in response to a user-initiated action (e.g. alt + link click or link click that returns a `Content-Disposition: attachment` response from the server). |url| is the target download URL and |request_function| is the target function (GET, POST, etc) nothrow. Return true (1) to proceed with the download or false (0) to cancel the download.

on_before_download
void function(cef_download_handler_t* self, cef_browser_t* browser, cef_download_item_t* download_item, const(cef_string_t)* suggested_name, cef_before_download_callback_t* callback) nothrow on_before_download;

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.

on_download_updated
void function(cef_download_handler_t* self, cef_browser_t* browser, cef_download_item_t* download_item, cef_download_item_callback_t* callback) nothrow on_download_updated;

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.

Meta