2014-01-06 20:48:18 +01:00
|
|
|
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +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.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/resource_handler_cpptoc.h"
|
2013-04-04 19:50:35 +02:00
|
|
|
#include "libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/ctocpp/auth_callback_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
2012-09-28 00:52:15 +02:00
|
|
|
#include "libcef_dll/ctocpp/quota_callback_ctocpp.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/ctocpp/request_ctocpp.h"
|
2012-09-28 22:14:02 +02:00
|
|
|
#include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2013-09-12 19:44:54 +02:00
|
|
|
int CEF_CALLBACK request_handler_on_before_browse(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame, cef_request_t* request, int is_redirect) {
|
|
|
|
// 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: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
|
|
|
if (!request)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeBrowse(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request),
|
|
|
|
is_redirect?true:false);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
int CEF_CALLBACK request_handler_on_before_resource_load(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame, cef_request_t* request) {
|
|
|
|
// 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: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
|
|
|
if (!request)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct _cef_resource_handler_t* CEF_CALLBACK request_handler_get_resource_handler(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame, cef_request_t* request) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return NULL;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
|
|
|
if (!browser)
|
|
|
|
return NULL;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
|
|
|
DCHECK(frame);
|
|
|
|
if (!frame)
|
|
|
|
return NULL;
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request);
|
|
|
|
if (!request)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefResourceHandler> _retval = CefRequestHandlerCppToC::Get(
|
|
|
|
self)->GetResourceHandler(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefRequestCToCpp::Wrap(request));
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefResourceHandlerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK request_handler_on_resource_redirect(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame, const cef_string_t* old_url, cef_string_t* new_url) {
|
|
|
|
// 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;
|
|
|
|
// Verify param: old_url; type: string_byref_const
|
|
|
|
DCHECK(old_url);
|
|
|
|
if (!old_url)
|
|
|
|
return;
|
|
|
|
// Verify param: new_url; type: string_byref
|
|
|
|
DCHECK(new_url);
|
|
|
|
if (!new_url)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Translate param: new_url; type: string_byref
|
|
|
|
CefString new_urlStr(new_url);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRequestHandlerCppToC::Get(self)->OnResourceRedirect(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefFrameCToCpp::Wrap(frame),
|
|
|
|
CefString(old_url),
|
|
|
|
new_urlStr);
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK request_handler_get_auth_credentials(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame, int isProxy, const cef_string_t* host, int port,
|
|
|
|
const cef_string_t* realm, const cef_string_t* scheme,
|
|
|
|
cef_auth_callback_t* callback) {
|
|
|
|
// 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: host; type: string_byref_const
|
|
|
|
DCHECK(host);
|
|
|
|
if (!host)
|
|
|
|
return 0;
|
|
|
|
// Verify param: scheme; type: string_byref_const
|
|
|
|
DCHECK(scheme);
|
|
|
|
if (!scheme)
|
|
|
|
return 0;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
|
|
|
if (!callback)
|
|
|
|
return 0;
|
|
|
|
// Unverified params: realm
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRequestHandlerCppToC::Get(self)->GetAuthCredentials(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefFrameCToCpp::Wrap(frame),
|
|
|
|
isProxy?true:false,
|
|
|
|
CefString(host),
|
|
|
|
port,
|
|
|
|
CefString(realm),
|
|
|
|
CefString(scheme),
|
|
|
|
CefAuthCallbackCToCpp::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2012-09-28 00:52:15 +02:00
|
|
|
int CEF_CALLBACK request_handler_on_quota_request(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
const cef_string_t* origin_url, int64 new_size,
|
|
|
|
cef_quota_callback_t* callback) {
|
|
|
|
// 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: origin_url; type: string_byref_const
|
|
|
|
DCHECK(origin_url);
|
|
|
|
if (!origin_url)
|
|
|
|
return 0;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
|
|
|
if (!callback)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRequestHandlerCppToC::Get(self)->OnQuotaRequest(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefString(origin_url),
|
|
|
|
new_size,
|
|
|
|
CefQuotaCallbackCToCpp::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2012-06-25 23:21:27 +02:00
|
|
|
void CEF_CALLBACK request_handler_on_protocol_execution(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
const cef_string_t* url, int* allow_os_execution) {
|
|
|
|
// 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: url; type: string_byref_const
|
|
|
|
DCHECK(url);
|
|
|
|
if (!url)
|
|
|
|
return;
|
|
|
|
// Verify param: allow_os_execution; type: bool_byref
|
|
|
|
DCHECK(allow_os_execution);
|
|
|
|
if (!allow_os_execution)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Translate param: allow_os_execution; type: bool_byref
|
|
|
|
bool allow_os_executionBool = (
|
|
|
|
allow_os_execution && *allow_os_execution)?true:false;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRequestHandlerCppToC::Get(self)->OnProtocolExecution(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefString(url),
|
|
|
|
allow_os_executionBool);
|
|
|
|
|
|
|
|
// Restore param: allow_os_execution; type: bool_byref
|
|
|
|
if (allow_os_execution)
|
|
|
|
*allow_os_execution = allow_os_executionBool?true:false;
|
|
|
|
}
|
|
|
|
|
2013-09-12 22:34:18 +02:00
|
|
|
int CEF_CALLBACK request_handler_on_certificate_error(
|
2014-01-06 20:59:48 +01:00
|
|
|
struct _cef_request_handler_t* self, cef_errorcode_t cert_error,
|
2013-09-12 22:34:18 +02:00
|
|
|
const cef_string_t* request_url,
|
|
|
|
cef_allow_certificate_error_callback_t* callback) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: request_url; type: string_byref_const
|
|
|
|
DCHECK(request_url);
|
|
|
|
if (!request_url)
|
|
|
|
return 0;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback);
|
|
|
|
if (!callback)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRequestHandlerCppToC::Get(self)->OnCertificateError(
|
|
|
|
cert_error,
|
|
|
|
CefString(request_url),
|
|
|
|
CefAllowCertificateErrorCallbackCToCpp::Wrap(callback));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2012-09-28 22:14:02 +02:00
|
|
|
int CEF_CALLBACK request_handler_on_before_plugin_load(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
const cef_string_t* url, const cef_string_t* policy_url,
|
|
|
|
struct _cef_web_plugin_info_t* info) {
|
|
|
|
// 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: info; type: refptr_diff
|
|
|
|
DCHECK(info);
|
|
|
|
if (!info)
|
|
|
|
return 0;
|
|
|
|
// Unverified params: url, policy_url
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforePluginLoad(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefString(url),
|
|
|
|
CefString(policy_url),
|
|
|
|
CefWebPluginInfoCToCpp::Wrap(info));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2013-09-12 22:34:18 +02:00
|
|
|
void CEF_CALLBACK request_handler_on_plugin_crashed(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
|
|
|
const cef_string_t* plugin_path) {
|
2013-04-04 19:50:35 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
2013-09-12 22:34:18 +02:00
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
|
|
|
if (!browser)
|
|
|
|
return;
|
|
|
|
// Verify param: plugin_path; type: string_byref_const
|
|
|
|
DCHECK(plugin_path);
|
|
|
|
if (!plugin_path)
|
|
|
|
return;
|
2013-04-04 19:50:35 +02:00
|
|
|
|
|
|
|
// Execute
|
2013-09-12 22:34:18 +02:00
|
|
|
CefRequestHandlerCppToC::Get(self)->OnPluginCrashed(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefString(plugin_path));
|
|
|
|
}
|
2013-04-04 19:50:35 +02:00
|
|
|
|
2013-09-12 22:34:18 +02:00
|
|
|
void CEF_CALLBACK request_handler_on_render_process_terminated(
|
|
|
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
2014-01-06 20:59:48 +01:00
|
|
|
cef_termination_status_t status) {
|
2013-09-12 22:34:18 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
|
|
|
DCHECK(browser);
|
|
|
|
if (!browser)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRequestHandlerCppToC::Get(self)->OnRenderProcessTerminated(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
status);
|
2013-04-04 19:50:35 +02:00
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls)
|
|
|
|
: CefCppToC<CefRequestHandlerCppToC, CefRequestHandler,
|
|
|
|
cef_request_handler_t>(cls) {
|
2013-09-12 19:44:54 +02:00
|
|
|
struct_.struct_.on_before_browse = request_handler_on_before_browse;
|
2012-04-03 03:34:16 +02:00
|
|
|
struct_.struct_.on_before_resource_load =
|
|
|
|
request_handler_on_before_resource_load;
|
|
|
|
struct_.struct_.get_resource_handler = request_handler_get_resource_handler;
|
|
|
|
struct_.struct_.on_resource_redirect = request_handler_on_resource_redirect;
|
|
|
|
struct_.struct_.get_auth_credentials = request_handler_get_auth_credentials;
|
2012-09-28 00:52:15 +02:00
|
|
|
struct_.struct_.on_quota_request = request_handler_on_quota_request;
|
2012-06-25 23:21:27 +02:00
|
|
|
struct_.struct_.on_protocol_execution = request_handler_on_protocol_execution;
|
2013-04-04 19:50:35 +02:00
|
|
|
struct_.struct_.on_certificate_error = request_handler_on_certificate_error;
|
2013-09-12 22:34:18 +02:00
|
|
|
struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load;
|
|
|
|
struct_.struct_.on_plugin_crashed = request_handler_on_plugin_crashed;
|
|
|
|
struct_.struct_.on_render_process_terminated =
|
|
|
|
request_handler_on_render_process_terminated;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
template<> long CefCppToC<CefRequestHandlerCppToC, CefRequestHandler,
|
|
|
|
cef_request_handler_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|