From 7ea66af1cca17e34c32220e78316b99cddb5dc47 Mon Sep 17 00:00:00 2001 From: jamespearce2006 Date: Mon, 18 May 2015 19:12:46 +0100 Subject: [PATCH 1/3] Auto-close blank popups when download is complete --- CefSharp.Core/Internals/DownloadAdapter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CefSharp.Core/Internals/DownloadAdapter.cpp b/CefSharp.Core/Internals/DownloadAdapter.cpp index 46cdfa49d5..4148734c08 100644 --- a/CefSharp.Core/Internals/DownloadAdapter.cpp +++ b/CefSharp.Core/Internals/DownloadAdapter.cpp @@ -38,6 +38,11 @@ namespace CefSharp void DownloadAdapter::OnDownloadUpdated(CefRefPtr browser, CefRefPtr download_item, CefRefPtr callback) { + if (!download_item->IsInProgress() && browser->IsPopup() && !browser->HasDocument()) + { + browser->GetHost()->CloseBrowser(false); + } + if (_handler->OnDownloadUpdated(TypeConversion::FromNative(download_item))) { callback->Cancel(); From ba0c0c1f19ff7239c2c30187d40feea51bd16623 Mon Sep 17 00:00:00 2001 From: jamespearce2006 Date: Mon, 18 May 2015 20:12:34 +0100 Subject: [PATCH 2/3] force appveyor rebuild --- CefSharp.Core/Internals/DownloadAdapter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/CefSharp.Core/Internals/DownloadAdapter.cpp b/CefSharp.Core/Internals/DownloadAdapter.cpp index 4148734c08..b07b4e6c80 100644 --- a/CefSharp.Core/Internals/DownloadAdapter.cpp +++ b/CefSharp.Core/Internals/DownloadAdapter.cpp @@ -38,6 +38,7 @@ namespace CefSharp void DownloadAdapter::OnDownloadUpdated(CefRefPtr browser, CefRefPtr download_item, CefRefPtr callback) { + if (!download_item->IsInProgress() && browser->IsPopup() && !browser->HasDocument()) { browser->GetHost()->CloseBrowser(false); From bbd366227d2b4d87a013635db4c65c38600fb33c Mon Sep 17 00:00:00 2001 From: jamespearce2006 Date: Tue, 19 May 2015 08:52:28 +0100 Subject: [PATCH 3/3] Remove added line --- CefSharp.Core/Internals/DownloadAdapter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/CefSharp.Core/Internals/DownloadAdapter.cpp b/CefSharp.Core/Internals/DownloadAdapter.cpp index b07b4e6c80..4148734c08 100644 --- a/CefSharp.Core/Internals/DownloadAdapter.cpp +++ b/CefSharp.Core/Internals/DownloadAdapter.cpp @@ -38,7 +38,6 @@ namespace CefSharp void DownloadAdapter::OnDownloadUpdated(CefRefPtr browser, CefRefPtr download_item, CefRefPtr callback) { - if (!download_item->IsInProgress() && browser->IsPopup() && !browser->HasDocument()) { browser->GetHost()->CloseBrowser(false);