mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefRequestHandler::OnCertificateError() callback (issue #345).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1176 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
47
libcef_dll/cpptoc/allow_certificate_error_callback_cpptoc.cc
Normal file
47
libcef_dll/cpptoc/allow_certificate_error_callback_cpptoc.cc
Normal file
@@ -0,0 +1,47 @@
|
||||
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
||||
// 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/allow_certificate_error_callback_cpptoc.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK allow_certificate_error_callback_cont(
|
||||
struct _cef_allow_certificate_error_callback_t* self, int allow) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefAllowCertificateErrorCallbackCppToC::Get(self)->Continue(
|
||||
allow?true:false);
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefAllowCertificateErrorCallbackCppToC::CefAllowCertificateErrorCallbackCppToC(
|
||||
CefAllowCertificateErrorCallback* cls)
|
||||
: CefCppToC<CefAllowCertificateErrorCallbackCppToC,
|
||||
CefAllowCertificateErrorCallback,
|
||||
cef_allow_certificate_error_callback_t>(cls) {
|
||||
struct_.struct_.cont = allow_certificate_error_callback_cont;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCppToC<CefAllowCertificateErrorCallbackCppToC,
|
||||
CefAllowCertificateErrorCallback,
|
||||
cef_allow_certificate_error_callback_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
39
libcef_dll/cpptoc/allow_certificate_error_callback_cpptoc.h
Normal file
39
libcef_dll/cpptoc/allow_certificate_error_callback_cpptoc.h
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_ALLOW_CERTIFICATE_ERROR_CALLBACK_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_ALLOW_CERTIFICATE_ERROR_CALLBACK_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_request_handler.h"
|
||||
#include "include/capi/cef_request_handler_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefAllowCertificateErrorCallbackCppToC
|
||||
: public CefCppToC<CefAllowCertificateErrorCallbackCppToC,
|
||||
CefAllowCertificateErrorCallback,
|
||||
cef_allow_certificate_error_callback_t> {
|
||||
public:
|
||||
explicit CefAllowCertificateErrorCallbackCppToC(
|
||||
CefAllowCertificateErrorCallback* cls);
|
||||
virtual ~CefAllowCertificateErrorCallbackCppToC() {}
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_ALLOW_CERTIFICATE_ERROR_CALLBACK_CPPTOC_H_
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/resource_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/auth_callback_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
|
||||
@@ -295,6 +296,34 @@ int CEF_CALLBACK request_handler_on_before_plugin_load(
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK request_handler_on_certificate_error(
|
||||
struct _cef_request_handler_t* self, enum cef_errorcode_t cert_error,
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
@@ -310,6 +339,7 @@ CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls)
|
||||
struct_.struct_.get_cookie_manager = request_handler_get_cookie_manager;
|
||||
struct_.struct_.on_protocol_execution = request_handler_on_protocol_execution;
|
||||
struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load;
|
||||
struct_.struct_.on_certificate_error = request_handler_on_certificate_error;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
Reference in New Issue
Block a user