2022-01-06 19:34:35 +01:00
|
|
|
// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
|
2012-04-19 22:31:46 +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.
|
|
|
|
//
|
2022-05-27 11:03:31 +02:00
|
|
|
// $hash=7f280440c705606151f40b5c50d62483e75ab0ba$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-04-19 22:31:46 +02:00
|
|
|
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/ctocpp/context_menu_handler_ctocpp.h"
|
2012-04-19 22:31:46 +02:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/context_menu_params_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/menu_model_cpptoc.h"
|
2015-09-09 16:05:39 +02:00
|
|
|
#include "libcef_dll/cpptoc/run_context_menu_callback_cpptoc.h"
|
2022-05-27 11:03:31 +02:00
|
|
|
#include "libcef_dll/cpptoc/run_quick_menu_callback_cpptoc.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2012-04-19 22:31:46 +02:00
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-19 22:31:46 +02:00
|
|
|
void CefContextMenuHandlerCToCpp::OnBeforeContextMenu(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefContextMenuParams> params,
|
|
|
|
CefRefPtr<CefMenuModel> model) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_context_menu_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_before_context_menu))
|
2012-04-19 22:31:46 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
|
|
|
return;
|
|
|
|
// Verify param: params; type: refptr_diff
|
|
|
|
DCHECK(params.get());
|
|
|
|
if (!params.get())
|
|
|
|
return;
|
|
|
|
// Verify param: model; type: refptr_diff
|
|
|
|
DCHECK(model.get());
|
|
|
|
if (!model.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
_struct->on_before_context_menu(_struct, CefBrowserCppToC::Wrap(browser),
|
|
|
|
CefFrameCppToC::Wrap(frame),
|
|
|
|
CefContextMenuParamsCppToC::Wrap(params),
|
|
|
|
CefMenuModelCppToC::Wrap(model));
|
2012-04-19 22:31:46 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-05-17 11:29:28 +02:00
|
|
|
bool CefContextMenuHandlerCToCpp::RunContextMenu(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefContextMenuParams> params,
|
2015-09-09 16:05:39 +02:00
|
|
|
CefRefPtr<CefMenuModel> model,
|
|
|
|
CefRefPtr<CefRunContextMenuCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-09-09 16:05:39 +02:00
|
|
|
cef_context_menu_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, run_context_menu))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: params; type: refptr_diff
|
|
|
|
DCHECK(params.get());
|
|
|
|
if (!params.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: model; type: refptr_diff
|
|
|
|
DCHECK(model.get());
|
|
|
|
if (!model.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
int _retval = _struct->run_context_menu(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefContextMenuParamsCppToC::Wrap(params), CefMenuModelCppToC::Wrap(model),
|
2015-09-09 16:05:39 +02:00
|
|
|
CefRunContextMenuCallbackCppToC::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2015-09-09 16:05:39 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-19 22:31:46 +02:00
|
|
|
bool CefContextMenuHandlerCToCpp::OnContextMenuCommand(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefContextMenuParams> params,
|
|
|
|
int command_id,
|
2012-04-19 22:31:46 +02:00
|
|
|
EventFlags event_flags) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_context_menu_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_context_menu_command))
|
2012-04-19 22:31:46 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: params; type: refptr_diff
|
|
|
|
DCHECK(params.get());
|
|
|
|
if (!params.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
int _retval = _struct->on_context_menu_command(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
CefContextMenuParamsCppToC::Wrap(params), command_id, event_flags);
|
2012-04-19 22:31:46 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
2017-05-17 11:29:28 +02:00
|
|
|
return _retval ? true : false;
|
2012-04-19 22:31:46 +02:00
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2012-04-19 22:31:46 +02:00
|
|
|
void CefContextMenuHandlerCToCpp::OnContextMenuDismissed(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_context_menu_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_context_menu_dismissed))
|
2012-04-19 22:31:46 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
_struct->on_context_menu_dismissed(_struct, CefBrowserCppToC::Wrap(browser),
|
|
|
|
CefFrameCppToC::Wrap(frame));
|
2012-04-19 22:31:46 +02:00
|
|
|
}
|
|
|
|
|
2022-05-27 11:03:31 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
bool CefContextMenuHandlerCToCpp::RunQuickMenu(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefPoint& location,
|
|
|
|
const CefSize& size,
|
|
|
|
QuickMenuEditStateFlags edit_state_flags,
|
|
|
|
CefRefPtr<CefRunQuickMenuCallback> callback) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_context_menu_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, run_quick_menu))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->run_quick_menu(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
&location, &size, edit_state_flags,
|
|
|
|
CefRunQuickMenuCallbackCppToC::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
bool CefContextMenuHandlerCToCpp::OnQuickMenuCommand(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
int command_id,
|
|
|
|
EventFlags event_flags) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_context_menu_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_quick_menu_command))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return false;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->on_quick_menu_command(
|
|
|
|
_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
|
|
|
|
command_id, event_flags);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefContextMenuHandlerCToCpp::OnQuickMenuDismissed(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_context_menu_handler_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_quick_menu_dismissed))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser.get());
|
|
|
|
if (!browser.get())
|
|
|
|
return;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame.get());
|
|
|
|
if (!frame.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_quick_menu_dismissed(_struct, CefBrowserCppToC::Wrap(browser),
|
|
|
|
CefFrameCppToC::Wrap(frame));
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
CefContextMenuHandlerCToCpp::CefContextMenuHandlerCToCpp() {}
|
2015-04-26 20:40:01 +02:00
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefContextMenuHandlerCToCpp::~CefContextMenuHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
cef_context_menu_handler_t* CefCToCppRefCounted<
|
|
|
|
CefContextMenuHandlerCToCpp,
|
|
|
|
CefContextMenuHandler,
|
|
|
|
cef_context_menu_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefContextMenuHandler* c) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2015-04-26 20:40:01 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefContextMenuHandlerCToCpp,
|
|
|
|
CefContextMenuHandler,
|
|
|
|
cef_context_menu_handler_t>::kWrapperType =
|
2015-04-26 20:40:01 +02:00
|
|
|
WT_CONTEXT_MENU_HANDLER;
|