mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add OnResourceReponse and CefContentFilter for viewing and filtering response content (issue #241).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@243 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/response_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/content_filter_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/request_handler_ctocpp.h"
|
||||
|
||||
@@ -54,6 +55,23 @@ bool CefRequestHandlerCToCpp::OnBeforeResourceLoad(
|
||||
return (rv ? true : false);
|
||||
}
|
||||
|
||||
void CefRequestHandlerCToCpp::OnResourceReponse(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& url, CefRefPtr<CefResponse> response,
|
||||
CefRefPtr<CefContentFilter>& filter)
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, on_resource_reponse))
|
||||
return;
|
||||
|
||||
cef_content_filter_t* filterRet = NULL;
|
||||
|
||||
struct_->on_resource_reponse(struct_,
|
||||
CefBrowserCppToC::Wrap(browser), url.GetStruct(),
|
||||
CefResponseCppToC::Wrap(response), &filterRet);
|
||||
|
||||
if(filterRet)
|
||||
filter = CefContentFilterCToCpp::Wrap(filterRet);
|
||||
}
|
||||
|
||||
bool CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr<CefBrowser> browser,
|
||||
const CefString& url, bool& allowOSExecution)
|
||||
{
|
||||
|
Reference in New Issue
Block a user