2023-01-02 23:47:15 +01:00
|
|
|
// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
|
2012-04-16 23:15:27 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
2023-01-02 23:47:15 +01:00
|
|
|
// $hash=351f3f71bc8fcee33ee063c17f34f7a9e7a99053$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-04-16 23:15:27 +02:00
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2012-04-16 23:15:27 +02:00
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
namespace {
|
|
|
|
|
2012-04-16 23:15:27 +02:00
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
jsdialog_handler_on_jsdialog(struct _cef_jsdialog_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
const cef_string_t* origin_url,
|
|
|
|
cef_jsdialog_type_t dialog_type,
|
|
|
|
const cef_string_t* message_text,
|
|
|
|
const cef_string_t* default_prompt_text,
|
|
|
|
cef_jsdialog_callback_t* callback,
|
|
|
|
int* suppress_message) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2012-04-16 23:15:27 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
// Verify param: suppress_message; type: bool_byref
|
|
|
|
DCHECK(suppress_message);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!suppress_message) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-04-27 22:38:52 +02:00
|
|
|
// Unverified params: origin_url, message_text, default_prompt_text
|
2012-04-16 23:15:27 +02:00
|
|
|
|
|
|
|
// Translate param: suppress_message; type: bool_byref
|
2017-05-17 11:29:28 +02:00
|
|
|
bool suppress_messageBool =
|
|
|
|
(suppress_message && *suppress_message) ? true : false;
|
2012-04-16 23:15:27 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnJSDialog(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefString(origin_url), dialog_type,
|
|
|
|
CefString(message_text), CefString(default_prompt_text),
|
|
|
|
CefJSDialogCallbackCToCpp::Wrap(callback), suppress_messageBool);
|
2012-04-16 23:15:27 +02:00
|
|
|
|
|
|
|
// Restore param: suppress_message; type: bool_byref
|
2023-01-02 23:47:15 +01:00
|
|
|
if (suppress_message) {
|
2017-05-17 11:29:28 +02:00
|
|
|
*suppress_message = suppress_messageBool ? true : false;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
jsdialog_handler_on_before_unload_dialog(struct _cef_jsdialog_handler_t* self,
|
|
|
|
cef_browser_t* browser,
|
|
|
|
const cef_string_t* message_text,
|
|
|
|
int is_reload,
|
|
|
|
cef_jsdialog_callback_t* callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2012-04-16 23:15:27 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
// Unverified params: message_text
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnBeforeUnloadDialog(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefString(message_text),
|
|
|
|
is_reload ? true : false, CefJSDialogCallbackCToCpp::Wrap(callback));
|
2012-04-16 23:15:27 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
jsdialog_handler_on_reset_dialog_state(struct _cef_jsdialog_handler_t* self,
|
|
|
|
cef_browser_t* browser) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2012-04-16 23:15:27 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2012-04-16 23:15:27 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-16 23:15:27 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefJSDialogHandlerCppToC::Get(self)->OnResetDialogState(
|
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CEF_CALLBACK
|
|
|
|
jsdialog_handler_on_dialog_closed(struct _cef_jsdialog_handler_t* self,
|
|
|
|
cef_browser_t* browser) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2013-05-31 15:45:21 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2013-05-31 15:45:21 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2013-05-31 15:45:21 +02:00
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!browser) {
|
2013-05-31 15:45:21 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2013-05-31 15:45:21 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefJSDialogHandlerCppToC::Get(self)->OnDialogClosed(
|
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
} // namespace
|
|
|
|
|
2012-04-16 23:15:27 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC() {
|
|
|
|
GetStruct()->on_jsdialog = jsdialog_handler_on_jsdialog;
|
|
|
|
GetStruct()->on_before_unload_dialog =
|
2012-04-16 23:15:27 +02:00
|
|
|
jsdialog_handler_on_before_unload_dialog;
|
2015-04-26 20:40:01 +02:00
|
|
|
GetStruct()->on_reset_dialog_state = jsdialog_handler_on_reset_dialog_state;
|
|
|
|
GetStruct()->on_dialog_closed = jsdialog_handler_on_dialog_closed;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefJSDialogHandlerCppToC::~CefJSDialogHandlerCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefJSDialogHandler> CefCppToCRefCounted<
|
|
|
|
CefJSDialogHandlerCppToC,
|
|
|
|
CefJSDialogHandler,
|
|
|
|
cef_jsdialog_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_jsdialog_handler_t* s) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2012-04-16 23:15:27 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefJSDialogHandlerCppToC,
|
|
|
|
CefJSDialogHandler,
|
|
|
|
cef_jsdialog_handler_t>::kWrapperType =
|
2015-04-26 20:40:01 +02:00
|
|
|
WT_JSDIALOG_HANDLER;
|