MCPcopy Create free account
hub / github.com/cztomczak/cefpython / OnBeforeDownload

Method OnBeforeDownload

src/client_handler/download_handler.cpp:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9void DownloadHandler::OnBeforeDownload(
10 CefRefPtr<CefBrowser> browser,
11 CefRefPtr<CefDownloadItem> download_item,
12 const CefString& suggested_name,
13 CefRefPtr<CefBeforeDownloadCallback> callback)
14{
15 REQUIRE_UI_THREAD();
16 bool downloads_enabled = ApplicationSettings_GetBool("downloads_enabled");
17 if (downloads_enabled) {
18 std::string msg = "[Browser process] About to download file: ";
19 msg.append(suggested_name.ToString().c_str());
20 LOG(INFO) << msg.c_str();
21 callback->Continue(suggested_name, true);
22 } else {
23 LOG(INFO) << "[Browser process] Tried to download file,"
24 " but downloads are disabled";
25 }
26}
27
28
29void DownloadHandler::OnDownloadUpdated(

Callers

nothing calls this directly

Calls 2

c_strMethod · 0.80
ToStringMethod · 0.80

Tested by

no test coverage detected