mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add permission callback for user-initated downloads (fixes issue #3183)
This change adds a CefDownloadHandler::CanDownload callback for optionally blocking user-initiated downloads (e.g. alt + link click or link click that returns a `Content-Disposition: attachment` response from the server). To test: - Run `ceftests --gtest_filter=DownloadTest.*`. - Run `cefclient --hide-controls`. User-initiated downloads will be blocked.
This commit is contained in:
@ -1225,6 +1225,13 @@ bool AlloyBrowserHostImpl::HandleContextMenu(
|
||||
return HandleContextMenu(web_contents(), params);
|
||||
}
|
||||
|
||||
void AlloyBrowserHostImpl::CanDownload(
|
||||
const GURL& url,
|
||||
const std::string& request_method,
|
||||
base::OnceCallback<void(bool)> callback) {
|
||||
contents_delegate_->CanDownload(url, request_method, std::move(callback));
|
||||
}
|
||||
|
||||
KeyboardEventProcessingResult AlloyBrowserHostImpl::PreHandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event) {
|
||||
|
Reference in New Issue
Block a user