2010-10-16 21:10:11 +02:00
|
|
|
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
|
2010-10-03 23:04:50 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// A portion of this file was generated by the CEF translator tool. When
|
|
|
|
// making changes by hand only do so within the body of existing function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
2010-10-16 21:10:11 +02:00
|
|
|
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
|
2010-10-03 23:04:50 +02:00
|
|
|
#include "libcef_dll/cpptoc/handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/request_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
|
|
|
|
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_before_created(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* parentBrowser,
|
2010-11-18 22:05:25 +01:00
|
|
|
cef_window_info_t* windowInfo, int popup,
|
|
|
|
const struct _cef_popup_features_t* popupFeatures,
|
|
|
|
struct _cef_handler_t** handler, cef_string_t* url,
|
|
|
|
struct _cef_browser_settings_t* settings)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(windowInfo);
|
|
|
|
DCHECK(handler && *handler);
|
|
|
|
DCHECK(url);
|
|
|
|
if(!self || !windowInfo || !handler || !*handler || !url)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
2010-11-18 22:05:25 +01:00
|
|
|
CefWindowInfo wndInfo;
|
|
|
|
CefBrowserSettings browserSettings;
|
|
|
|
CefPopupFeatures features;
|
|
|
|
|
|
|
|
// Take ownership of the pointers instead of copying.
|
|
|
|
wndInfo.Attach(*windowInfo);
|
|
|
|
browserSettings.Attach(*settings);
|
|
|
|
features.Attach(*popupFeatures);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
// |newHandler| will start off pointing to the current handler.
|
|
|
|
CefRefPtr<CefHandler> handlerPtr = CefHandlerCppToC::Unwrap(*handler);
|
|
|
|
CefHandler* origHandler = handlerPtr.get();
|
|
|
|
|
|
|
|
// |parentBrowser| will be NULL if this is a top-level browser window.
|
|
|
|
CefRefPtr<CefBrowser> browserPtr;
|
|
|
|
if(parentBrowser)
|
|
|
|
browserPtr = CefBrowserCToCpp::Wrap(parentBrowser);
|
|
|
|
|
|
|
|
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleBeforeCreated(
|
2010-11-22 18:49:46 +01:00
|
|
|
browserPtr, wndInfo, popup?true:false, features, handlerPtr,
|
|
|
|
CefString(url), browserSettings);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
if(handlerPtr.get() != origHandler) {
|
2010-10-03 23:04:50 +02:00
|
|
|
// The handler has been changed.
|
|
|
|
*handler = CefHandlerCppToC::Wrap(handlerPtr);
|
|
|
|
}
|
|
|
|
|
2010-11-18 22:05:25 +01:00
|
|
|
// Window info may or may not have changed.
|
2010-10-03 23:04:50 +02:00
|
|
|
*windowInfo = wndInfo;
|
2010-11-18 22:05:25 +01:00
|
|
|
|
|
|
|
// Browser settings may or may not have changed.
|
|
|
|
*settings = browserSettings;
|
|
|
|
|
|
|
|
// Don't free the pointers.
|
|
|
|
features.Detach();
|
|
|
|
wndInfo.Detach();
|
|
|
|
browserSettings.Detach();
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_after_created(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleAfterCreated(
|
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_address_change(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* url)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
if(!self || !browser || !frame)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleAddressChange(
|
2010-11-22 18:49:46 +01:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefString(url));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_title_change(
|
2010-11-22 18:49:46 +01:00
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
const cef_string_t* title)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleTitleChange(
|
2010-11-22 18:49:46 +01:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefString(title));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_before_browse(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
|
|
|
struct _cef_request_t* request, enum cef_handler_navtype_t navType,
|
|
|
|
int isRedirect)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
DCHECK(request);
|
|
|
|
if(!self || !browser || !request || !frame)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleBeforeBrowse(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request), navType, (isRedirect ? true : false));
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_load_start(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
CefRefPtr<CefFrame> framePtr;
|
|
|
|
if(frame)
|
|
|
|
framePtr = CefFrameCToCpp::Wrap(frame);
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleLoadStart(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), framePtr);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_load_end(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
CefRefPtr<CefFrame> framePtr;
|
|
|
|
if(frame)
|
|
|
|
framePtr = CefFrameCToCpp::Wrap(frame);
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleLoadEnd(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), framePtr);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_load_error(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl,
|
2010-10-03 23:04:50 +02:00
|
|
|
cef_string_t* errorText)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
DCHECK(errorText);
|
|
|
|
if(!self || !browser || !errorText || !frame)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
return CefHandlerCppToC::Get(self)->HandleLoadError(
|
2010-10-03 23:04:50 +02:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), errorCode,
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString(failedUrl), CefString(errorText));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_before_resource_load(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
struct _cef_request_t* request, cef_string_t* redirectUrl,
|
|
|
|
struct _cef_stream_reader_t** resourceStream, cef_string_t* mimeType,
|
|
|
|
int loadFlags)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(redirectUrl);
|
|
|
|
DCHECK(resourceStream);
|
|
|
|
DCHECK(mimeType);
|
|
|
|
if(!self || !browser || !redirectUrl || !resourceStream || !mimeType)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
CefRefPtr<CefStreamReader> streamPtr;
|
|
|
|
|
|
|
|
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->
|
|
|
|
HandleBeforeResourceLoad(CefBrowserCToCpp::Wrap(browser),
|
2010-11-22 18:49:46 +01:00
|
|
|
CefRequestCToCpp::Wrap(request), CefString(redirectUrl), streamPtr,
|
|
|
|
CefString(mimeType), loadFlags);
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
if(streamPtr.get())
|
|
|
|
*resourceStream = CefStreamReaderCToCpp::Unwrap(streamPtr);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2010-10-16 21:10:11 +02:00
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_download_response(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* mimeType, const cef_string_t* fileName,
|
|
|
|
int64 contentLength, struct _cef_download_handler_t** handler)
|
2010-10-16 21:10:11 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(mimeType);
|
|
|
|
DCHECK(fileName);
|
|
|
|
if(!self || !browser || !mimeType || !fileName)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
CefRefPtr<CefDownloadHandler> downloadPtr;
|
|
|
|
|
|
|
|
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->
|
2010-11-22 18:49:46 +01:00
|
|
|
HandleDownloadResponse(CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefString(mimeType), CefString(fileName), contentLength, downloadPtr);
|
2010-10-16 21:10:11 +02:00
|
|
|
|
|
|
|
if(downloadPtr.get())
|
|
|
|
*handler = CefDownloadHandlerCppToC::Wrap(downloadPtr);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_before_menu(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
const cef_handler_menuinfo_t* menuInfo)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(menuInfo);
|
|
|
|
if(!self || !browser || !menuInfo)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleBeforeMenu(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), *menuInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_get_menu_label(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
enum cef_handler_menuid_t menuId, cef_string_t* label)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(label);
|
|
|
|
if(!self || !browser || !label)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
return CefHandlerCppToC::Get(self)->HandleGetMenuLabel(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), menuId, CefString(label));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_menu_action(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
enum cef_handler_menuid_t menuId)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleMenuAction(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), menuId);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_print_options(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
struct _cef_print_options_t* printOptions)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(printOptions);
|
|
|
|
if(!self || !browser || !printOptions)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandlePrintOptions(CefBrowserCToCpp::Wrap(browser), *printOptions);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_print_header_footer(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
cef_print_info_t* printInfo, const cef_string_t* url,
|
|
|
|
const cef_string_t* title, int currentPage, int maxPages,
|
|
|
|
cef_string_t* topLeft, cef_string_t* topCenter, cef_string_t* topRight,
|
|
|
|
cef_string_t* bottomLeft, cef_string_t* bottomCenter,
|
|
|
|
cef_string_t* bottomRight)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
DCHECK(printInfo);
|
|
|
|
DCHECK(topLeft && topCenter && topRight);
|
|
|
|
DCHECK(bottomLeft && bottomCenter && bottomRight);
|
|
|
|
if(!self || !browser || !frame || !printInfo || !topLeft || !topCenter
|
|
|
|
|| !topRight || !bottomLeft || !bottomCenter || !bottomRight)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
CefPrintInfo info = *printInfo;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
return CefHandlerCppToC::Get(self)->
|
2010-10-03 23:04:50 +02:00
|
|
|
HandlePrintHeaderFooter(CefBrowserCToCpp::Wrap(browser),
|
2010-11-22 18:49:46 +01:00
|
|
|
CefFrameCToCpp::Wrap(frame), info, CefString(url), CefString(title),
|
|
|
|
currentPage, maxPages, CefString(topLeft), CefString(topCenter),
|
|
|
|
CefString(topRight), CefString(bottomLeft), CefString(bottomCenter),
|
|
|
|
CefString(bottomRight));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_jsalert(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* message)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
if(!self || !browser || !frame)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleJSAlert(
|
2010-11-22 18:49:46 +01:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefString(message));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_jsconfirm(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* message, int* retval)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
DCHECK(retval);
|
|
|
|
if(!self || !browser || !retval || !frame)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
bool ret = false;
|
|
|
|
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleJSConfirm(
|
2010-11-22 18:49:46 +01:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefString(message), ret);
|
2010-10-03 23:04:50 +02:00
|
|
|
*retval = (ret ? 1 : 0);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_jsprompt(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* message, const cef_string_t* defaultValue, int* retval,
|
2010-10-03 23:04:50 +02:00
|
|
|
cef_string_t* result)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
DCHECK(retval);
|
|
|
|
DCHECK(result);
|
|
|
|
if(!self || !browser || !frame || !retval || !result)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
bool ret = false;
|
|
|
|
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleJSPrompt(
|
2010-11-22 18:49:46 +01:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefString(message), CefString(defaultValue), ret, CefString(result));
|
2010-10-03 23:04:50 +02:00
|
|
|
*retval = (ret ? 1 : 0);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_jsbinding(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
|
|
|
struct _cef_v8value_t* object)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(frame);
|
|
|
|
DCHECK(object);
|
|
|
|
if(!self || !browser || !frame || !object)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleJSBinding(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefV8ValueCToCpp::Wrap(object));
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_before_window_close(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleBeforeWindowClose(
|
|
|
|
CefBrowserCToCpp::Wrap(browser));
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_take_focus(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, int reverse)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleTakeFocus(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), (reverse ? true : false));
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_set_focus(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, int isWidget)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleSetFocus(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), isWidget?true:false);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_key_event(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
enum cef_handler_keyevent_type_t type, int code, int modifiers,
|
|
|
|
int isSystemKey)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleKeyEvent(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), type, code,
|
|
|
|
modifiers, isSystemKey?true:false);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_tooltip(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_string_t* text)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
DCHECK(text);
|
|
|
|
if(!self || !browser || !text)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
return CefHandlerCppToC::Get(self)->HandleTooltip(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), CefString(text));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_console_message(
|
2010-11-22 18:49:46 +01:00
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser,
|
|
|
|
const cef_string_t* message, const cef_string_t* source, int line)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleConsoleMessage(
|
2010-11-22 18:49:46 +01:00
|
|
|
CefBrowserCToCpp::Wrap(browser), CefString(message), CefString(source),
|
|
|
|
line);
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
enum cef_retval_t CEF_CALLBACK handler_handle_find_result(
|
|
|
|
struct _cef_handler_t* self, cef_browser_t* browser, int identifier,
|
|
|
|
int count, const cef_rect_t* selectionRect, int activeMatchOrdinal,
|
|
|
|
int finalUpdate)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(browser);
|
|
|
|
if(!self || !browser)
|
|
|
|
return RV_CONTINUE;
|
|
|
|
|
|
|
|
CefRect rect(*selectionRect);
|
|
|
|
return CefHandlerCppToC::Get(self)->HandleFindResult(
|
|
|
|
CefBrowserCToCpp::Wrap(browser), identifier, count, rect,
|
|
|
|
activeMatchOrdinal, finalUpdate?true:false);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefHandlerCppToC::CefHandlerCppToC(CefHandler* cls)
|
|
|
|
: CefCppToC<CefHandlerCppToC, CefHandler, cef_handler_t>(cls)
|
|
|
|
{
|
|
|
|
struct_.struct_.handle_before_created = handler_handle_before_created;
|
|
|
|
struct_.struct_.handle_after_created = handler_handle_after_created;
|
|
|
|
struct_.struct_.handle_address_change = handler_handle_address_change;
|
|
|
|
struct_.struct_.handle_title_change = handler_handle_title_change;
|
|
|
|
struct_.struct_.handle_before_browse = handler_handle_before_browse;
|
|
|
|
struct_.struct_.handle_load_start = handler_handle_load_start;
|
|
|
|
struct_.struct_.handle_load_end = handler_handle_load_end;
|
|
|
|
struct_.struct_.handle_load_error = handler_handle_load_error;
|
|
|
|
struct_.struct_.handle_before_resource_load =
|
|
|
|
handler_handle_before_resource_load;
|
2010-10-16 21:10:11 +02:00
|
|
|
struct_.struct_.handle_download_response = handler_handle_download_response;
|
2010-10-03 23:04:50 +02:00
|
|
|
struct_.struct_.handle_before_menu = handler_handle_before_menu;
|
|
|
|
struct_.struct_.handle_get_menu_label = handler_handle_get_menu_label;
|
|
|
|
struct_.struct_.handle_menu_action = handler_handle_menu_action;
|
|
|
|
struct_.struct_.handle_print_options = handler_handle_print_options;
|
|
|
|
struct_.struct_.handle_print_header_footer =
|
|
|
|
handler_handle_print_header_footer;
|
|
|
|
struct_.struct_.handle_jsalert = handler_handle_jsalert;
|
|
|
|
struct_.struct_.handle_jsconfirm = handler_handle_jsconfirm;
|
|
|
|
struct_.struct_.handle_jsprompt = handler_handle_jsprompt;
|
|
|
|
struct_.struct_.handle_jsbinding = handler_handle_jsbinding;
|
|
|
|
struct_.struct_.handle_before_window_close =
|
|
|
|
handler_handle_before_window_close;
|
|
|
|
struct_.struct_.handle_take_focus = handler_handle_take_focus;
|
|
|
|
struct_.struct_.handle_set_focus = handler_handle_set_focus;
|
|
|
|
struct_.struct_.handle_key_event = handler_handle_key_event;
|
|
|
|
struct_.struct_.handle_tooltip = handler_handle_tooltip;
|
|
|
|
struct_.struct_.handle_console_message = handler_handle_console_message;
|
|
|
|
struct_.struct_.handle_find_result = handler_handle_find_result;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
long CefCppToC<CefHandlerCppToC, CefHandler, cef_handler_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|