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:
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=172a12dd9e68b65afff9eef5b93f0e480beaf904$
|
||||
// $hash=fa32af3253cface693ec3ef420863852f5c68379$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_
|
||||
@@ -35,6 +35,9 @@ class CefDownloadHandlerCToCpp
|
||||
virtual ~CefDownloadHandlerCToCpp();
|
||||
|
||||
// CefDownloadHandler methods.
|
||||
bool CanDownload(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& url,
|
||||
const CefString& request_method) override;
|
||||
void OnBeforeDownload(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefDownloadItem> download_item,
|
||||
const CefString& suggested_name,
|
||||
|
Reference in New Issue
Block a user