diff --git a/CefSharp.Core/Internals/CefSharpBrowserWrapper.cpp b/CefSharp.Core/Internals/CefSharpBrowserWrapper.cpp index 6ba3cb740..59c56a9c5 100644 --- a/CefSharp.Core/Internals/CefSharpBrowserWrapper.cpp +++ b/CefSharp.Core/Internals/CefSharpBrowserWrapper.cpp @@ -236,6 +236,12 @@ bool CefSharpBrowserWrapper::SendProcessMessage(CefProcessId targetProcess, CefR return _browser->SendProcessMessage(targetProcess, message); } +void CefSharpBrowserWrapper::StartDownload(String^ url) +{ + ThrowIfDisposed(); + _browser->GetHost()->StartDownload(StringUtils::ToNative(url)); +} + void CefSharpBrowserWrapper::ThrowIfDisposed() { if (_disposed) diff --git a/CefSharp.Core/Internals/CefSharpBrowserWrapper.h b/CefSharp.Core/Internals/CefSharpBrowserWrapper.h index 9d4c18e1b..c3b1a0512 100644 --- a/CefSharp.Core/Internals/CefSharpBrowserWrapper.h +++ b/CefSharp.Core/Internals/CefSharpBrowserWrapper.h @@ -195,6 +195,8 @@ namespace CefSharp /// /*--cef()--*/ virtual bool SendProcessMessage(CefProcessId targetProcess, CefRefPtr message); + + virtual void StartDownload(String^ url); }; } } \ No newline at end of file diff --git a/CefSharp/IBrowser.cs b/CefSharp/IBrowser.cs index e0403fef7..97847836c 100644 --- a/CefSharp/IBrowser.cs +++ b/CefSharp/IBrowser.cs @@ -154,5 +154,10 @@ namespace CefSharp //virtual bool SendProcessMessage(CefProcessId target_process, // CefRefPtr message) =0; + /// + /// Download the file at url specified + /// + /// url to download + void StartDownload(string url); } }