diff --git a/FCHost/fchost/fchost_handler.cc b/FCHost/fchost/fchost_handler.cc index 51fa309b5d216b3fcc786a462524d628ce31b92e..e2c52b80f16664865e2598e968a7f58079ae7a3c 100644 --- a/FCHost/fchost/fchost_handler.cc +++ b/FCHost/fchost/fchost_handler.cc @@ -174,7 +174,7 @@ void FCHostHandler::OnLoadEnd(CefRefPtr<CefBrowser> browser, }", frame->GetURL(), 0); } -void FCHostHandler::OnBeforeDownload(CefRefPtr<CefBrowser> browser, +bool FCHostHandler::OnBeforeDownload(CefRefPtr<CefBrowser> browser, CefRefPtr<CefDownloadItem> download_item, const CefString& suggested_name, CefRefPtr< CefBeforeDownloadCallback > callback) @@ -182,6 +182,8 @@ void FCHostHandler::OnBeforeDownload(CefRefPtr<CefBrowser> browser, CEF_REQUIRE_UI_THREAD(); callback->Continue(suggested_name, true); + + return true; } bool FCHostHandler::OnPreKeyEvent(CefRefPtr<CefBrowser> browser, diff --git a/FCHost/fchost/fchost_handler.h b/FCHost/fchost/fchost_handler.h index 0b9577556f096f7e3472adb719302d521561f2de..fe81804ac3a2f1e1c291d73fab8c8fc0989ff33c 100644 --- a/FCHost/fchost/fchost_handler.h +++ b/FCHost/fchost/fchost_handler.h @@ -36,9 +36,14 @@ class FCHostHandler : public CefClient, virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() override { return this; } CefRefPtr< CefDialogHandler > GetDialogHandler() override { return this; } - bool OnFileDialog(CefRefPtr<CefBrowser> browser, CefDialogHandler::FileDialogMode mode, - const CefString& title, const CefString& default_file_path, const std::vector<CefString>& accept_filters, - CefRefPtr<CefFileDialogCallback> callback) override; + bool OnFileDialog(CefRefPtr<CefBrowser> browser, + CefDialogHandler::FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector<CefString>& accept_filters, + const std::vector<CefString>& accept_extensions, + const std::vector<CefString>& accept_descriptions, + CefRefPtr<CefFileDialogCallback> callback) override; // CefDisplayHandler methods: virtual void OnTitleChange(CefRefPtr<CefBrowser> browser, @@ -65,7 +70,7 @@ class FCHostHandler : public CefClient, int httpStatusCode) override; // CefDownloadHandler methods: - virtual void OnBeforeDownload(CefRefPtr<CefBrowser> browser, + virtual bool OnBeforeDownload(CefRefPtr<CefBrowser> browser, CefRefPtr<CefDownloadItem> download_item, const CefString& suggested_name, CefRefPtr< CefBeforeDownloadCallback > callback) override; diff --git a/FCHost/fchost/fchost_handler_linux.cc b/FCHost/fchost/fchost_handler_linux.cc index 9e02a67bf31562a7bfbc453f150d4f3852ecf0b0..bbac273eee971e10a76413b75b9304640df36b91 100644 --- a/FCHost/fchost/fchost_handler_linux.cc +++ b/FCHost/fchost/fchost_handler_linux.cc @@ -233,9 +233,14 @@ void FCHostHandler::PlatformTitleChange(CefRefPtr<CefBrowser> browser, const Cef #endif // defined(CEF_X11) } -bool FCHostHandler::OnFileDialog(CefRefPtr<CefBrowser> /* browser */, CefDialogHandler::FileDialogMode mode, - const CefString& title, const CefString& default_file_path, const std::vector<CefString>& accept_filters, - CefRefPtr<CefFileDialogCallback> callback) +bool FCHostHandler::OnFileDialog(CefRefPtr<CefBrowser> /* browser */, + CefDialogHandler::FileDialogMode mode, + const CefString& title, + const CefString& default_file_path, + const std::vector<CefString>& accept_filters, + const std::vector<CefString>& /* accept_extensions */, + const std::vector<CefString>& /* accept_descriptions */, + CefRefPtr<CefFileDialogCallback> callback) { static DialogHelper helper; diff --git a/FCHost/fchost/fchost_handler_win.cc b/FCHost/fchost/fchost_handler_win.cc index 2713b6055ca93e207d3f39f040d8c75c28dc0348..d70d5d0d1cf4442fa5a627e3acd422ea8cb34b5d 100644 --- a/FCHost/fchost/fchost_handler_win.cc +++ b/FCHost/fchost/fchost_handler_win.cc @@ -27,9 +27,14 @@ void FCHostHandler::PlatformTitleChange(CefRefPtr<CefBrowser> browser, SetWindowText(hwnd, std::wstring(title).c_str()); } -bool FCHostHandler::OnFileDialog(CefRefPtr<CefBrowser> /* browser */, CefDialogHandler::FileDialogMode /* mode */, - const CefString& /* title */, const CefString& /* default_file_path */, const std::vector<CefString>& /* accept_filters */, - CefRefPtr<CefFileDialogCallback> /* callback */) +bool FCHostHandler::OnFileDialog(CefRefPtr<CefBrowser> /* browser */, + CefDialogHandler::FileDialogMode /* mode */, + const CefString& /* title */, + const CefString& /* default_file_path */, + const std::vector<CefString>& /* accept_filters */, + const std::vector<CefString>& /* accept_extensions */, + const std::vector<CefString>& /* accept_descriptions */, + CefRefPtr<CefFileDialogCallback> /* callback */) { return false; // to display the default dialog }