From 401101ba4f0bb6f42e42ce2ab094ee3db6810841 Mon Sep 17 00:00:00 2001 From: jornh Date: Thu, 12 Jun 2014 19:55:25 +0200 Subject: [PATCH] Add fix for #388 so default JSDialogs don't show up if not wanted --- CefSharp.Core/Internals/ClientAdapter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core/Internals/ClientAdapter.cpp index c957a1403..14b8cfdff 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core/Internals/ClientAdapter.cpp @@ -421,7 +421,7 @@ namespace CefSharp } bool result; - bool handled; + bool handled = false; switch (dialog_type) { @@ -436,14 +436,13 @@ namespace CefSharp case JSDIALOGTYPE_PROMPT: String^ resultString = nullptr; - result = handler->OnJSPrompt(_browserControl, StringUtils::ToClr(origin_url), StringUtils::ToClr(message_text), + handled = handler->OnJSPrompt(_browserControl, StringUtils::ToClr(origin_url), StringUtils::ToClr(message_text), StringUtils::ToClr(default_prompt_text), result, resultString); callback->Continue(result, StringUtils::ToNative(resultString)); break; } - // Unknown dialog type, so we return "not handled". - return false; + return handled; } bool ClientAdapter::OnFileDialog(CefRefPtr browser, FileDialogMode mode, const CefString& title,