2018-01-03 21:46:26 +01:00
|
|
|
// Copyright (c) 2018 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.
|
|
|
|
//
|
2018-07-12 19:55:56 +02:00
|
|
|
// $hash=24773b11214ee3ee5b5a1772f515c292bfaf5485$
|
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"
|
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) {
|
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) {
|
|
|
|
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) {
|
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) {
|
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
|
|
|
}
|
|
|
|
|
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
|
|
|
|
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;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-09-01 13:24:30 +02:00
|
|
|
#if DCHECK_IS_ON()
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
2017-07-27 01:19:27 +02:00
|
|
|
base::AtomicRefCount CefCToCppRefCounted<CefContextMenuHandlerCToCpp,
|
|
|
|
CefContextMenuHandler,
|
|
|
|
cef_context_menu_handler_t>::DebugObjCt
|
|
|
|
ATOMIC_DECLARATION;
|
2012-04-19 22:31:46 +02:00
|
|
|
#endif
|
|
|
|
|
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;
|