From b5700a6f4c4303b1bf7f43ea05f71e4e0afe35ad Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 11 Feb 2014 20:23:00 +0000 Subject: [PATCH] Make |origin_url| parameter to CefJSDialogHandler::OnJsDialog optional since it may be empty for non-standard schemes (issue #1106). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1621 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- include/cef_jsdialog_handler.h | 4 ++-- libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc | 7 ++----- libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc | 7 ++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/cef_jsdialog_handler.h b/include/cef_jsdialog_handler.h index 419ba13d0..29548966e 100644 --- a/include/cef_jsdialog_handler.h +++ b/include/cef_jsdialog_handler.h @@ -81,8 +81,8 @@ class CefJSDialogHandler : public virtual CefBase { // modal or modeless. If a custom dialog is used the application must execute // |callback| once the custom dialog is dismissed. /// - /*--cef(optional_param=accept_lang,optional_param=message_text, - optional_param=default_prompt_text)--*/ + /*--cef(optional_param=origin_url,optional_param=accept_lang, + optional_param=message_text,optional_param=default_prompt_text)--*/ virtual bool OnJSDialog(CefRefPtr browser, const CefString& origin_url, const CefString& accept_lang, diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc index 7833c9d6e..c0ae67efa 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc @@ -32,10 +32,6 @@ int CEF_CALLBACK jsdialog_handler_on_jsdialog( DCHECK(browser); if (!browser) return 0; - // Verify param: origin_url; type: string_byref_const - DCHECK(origin_url); - if (!origin_url) - return 0; // Verify param: callback; type: refptr_diff DCHECK(callback); if (!callback) @@ -44,7 +40,8 @@ int CEF_CALLBACK jsdialog_handler_on_jsdialog( DCHECK(suppress_message); if (!suppress_message) return 0; - // Unverified params: accept_lang, message_text, default_prompt_text + // Unverified params: origin_url, accept_lang, message_text, + default_prompt_text // Translate param: suppress_message; type: bool_byref bool suppress_messageBool = ( diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc index 4f7745629..180c88ea4 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc @@ -31,15 +31,12 @@ bool CefJSDialogHandlerCToCpp::OnJSDialog(CefRefPtr browser, DCHECK(browser.get()); if (!browser.get()) return false; - // Verify param: origin_url; type: string_byref_const - DCHECK(!origin_url.empty()); - if (origin_url.empty()) - return false; // Verify param: callback; type: refptr_diff DCHECK(callback.get()); if (!callback.get()) return false; - // Unverified params: accept_lang, message_text, default_prompt_text + // Unverified params: origin_url, accept_lang, message_text, + default_prompt_text // Translate param: suppress_message; type: bool_byref int suppress_messageInt = suppress_message;