mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
alloy: Add touch handle and quick menu support for OSR (fixes issue #3268)
The client is responsible for rendering both as no default implementation is currently available for OSR.
This commit is contained in:
committed by
Marshall Greenblatt
parent
771e5c7c0c
commit
d9b764860a
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=a689271e9c27cfd0d6f6fadb8bb624898f165934$
|
||||
// $hash=1531579b642c3009765e7ef273887c423e552b36$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h"
|
||||
@ -18,6 +18,7 @@
|
||||
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/menu_model_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/run_context_menu_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/run_quick_menu_callback_ctocpp.h"
|
||||
#include "libcef_dll/shutdown_checker.h"
|
||||
|
||||
namespace {
|
||||
@ -167,6 +168,112 @@ void CEF_CALLBACK context_menu_handler_on_context_menu_dismissed(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame));
|
||||
}
|
||||
|
||||
int CEF_CALLBACK context_menu_handler_run_quick_menu(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
const cef_point_t* location,
|
||||
const cef_size_t* size,
|
||||
cef_quick_menu_edit_state_flags_t edit_state_flags,
|
||||
cef_run_quick_menu_callback_t* callback) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return 0;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return 0;
|
||||
// Verify param: location; type: simple_byref_const
|
||||
DCHECK(location);
|
||||
if (!location)
|
||||
return 0;
|
||||
// Verify param: size; type: simple_byref_const
|
||||
DCHECK(size);
|
||||
if (!size)
|
||||
return 0;
|
||||
// Verify param: callback; type: refptr_diff
|
||||
DCHECK(callback);
|
||||
if (!callback)
|
||||
return 0;
|
||||
|
||||
// Translate param: location; type: simple_byref_const
|
||||
CefPoint locationVal = location ? *location : CefPoint();
|
||||
// Translate param: size; type: simple_byref_const
|
||||
CefSize sizeVal = size ? *size : CefSize();
|
||||
|
||||
// Execute
|
||||
bool _retval = CefContextMenuHandlerCppToC::Get(self)->RunQuickMenu(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), locationVal,
|
||||
sizeVal, edit_state_flags, CefRunQuickMenuCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK context_menu_handler_on_quick_menu_command(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame,
|
||||
int command_id,
|
||||
cef_event_flags_t event_flags) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return 0;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefContextMenuHandlerCppToC::Get(self)->OnQuickMenuCommand(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), command_id,
|
||||
event_flags);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK context_menu_handler_on_quick_menu_dismissed(
|
||||
struct _cef_context_menu_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
struct _cef_frame_t* frame) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
// Verify param: frame; type: refptr_diff
|
||||
DCHECK(frame);
|
||||
if (!frame)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefContextMenuHandlerCppToC::Get(self)->OnQuickMenuDismissed(
|
||||
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
@ -179,6 +286,11 @@ CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC() {
|
||||
context_menu_handler_on_context_menu_command;
|
||||
GetStruct()->on_context_menu_dismissed =
|
||||
context_menu_handler_on_context_menu_dismissed;
|
||||
GetStruct()->run_quick_menu = context_menu_handler_run_quick_menu;
|
||||
GetStruct()->on_quick_menu_command =
|
||||
context_menu_handler_on_quick_menu_command;
|
||||
GetStruct()->on_quick_menu_dismissed =
|
||||
context_menu_handler_on_quick_menu_dismissed;
|
||||
}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
Reference in New Issue
Block a user