mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add support for returning an HTTP status code from HandleBeforeResourceLoad and custom scheme handlers via the CefResponse class (issue #202).
- Add unit tests for custom scheme handlers (issue #221). - Fix reversed enable/disable of stop and reload buttons in cefclient. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@222 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -25,6 +25,15 @@ int CEF_CALLBACK response_get_status(struct _cef_response_t* self)
|
||||
return CefResponseCppToC::Get(self)->GetStatus();
|
||||
}
|
||||
|
||||
void CEF_CALLBACK response_set_status(struct _cef_response_t* self, int status)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return;
|
||||
|
||||
CefResponseCppToC::Get(self)->SetStatus(status);
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK response_get_status_text(
|
||||
struct _cef_response_t* self)
|
||||
{
|
||||
@ -36,6 +45,37 @@ cef_string_userfree_t CEF_CALLBACK response_get_status_text(
|
||||
return text.DetachToUserFree();
|
||||
}
|
||||
|
||||
void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self,
|
||||
const cef_string_t* statusText)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return;
|
||||
|
||||
CefResponseCppToC::Get(self)->SetStatusText(CefString(statusText));
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK response_get_mime_type(
|
||||
struct _cef_response_t* self)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return NULL;
|
||||
|
||||
CefString text = CefResponseCppToC::Get(self)->GetMimeType();
|
||||
return text.DetachToUserFree();
|
||||
}
|
||||
|
||||
void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self,
|
||||
const cef_string_t* mimeType)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return;
|
||||
|
||||
CefResponseCppToC::Get(self)->SetMimeType(CefString(mimeType));
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK response_get_header(
|
||||
struct _cef_response_t* self, const cef_string_t* name)
|
||||
{
|
||||
@ -59,6 +99,20 @@ void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self,
|
||||
transfer_string_map_contents(map, headerMap);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self,
|
||||
cef_string_map_t headerMap)
|
||||
{
|
||||
DCHECK(self);
|
||||
if(!self)
|
||||
return;
|
||||
|
||||
CefResponse::HeaderMap map;
|
||||
if(headerMap)
|
||||
transfer_string_map_contents(headerMap, map);
|
||||
|
||||
CefResponseCppToC::Get(self)->SetHeaderMap(map);
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
@ -66,9 +120,14 @@ CefResponseCppToC::CefResponseCppToC(CefResponse* cls)
|
||||
: CefCppToC<CefResponseCppToC, CefResponse, cef_response_t>(cls)
|
||||
{
|
||||
struct_.struct_.get_status = response_get_status;
|
||||
struct_.struct_.set_status = response_set_status;
|
||||
struct_.struct_.get_status_text = response_get_status_text;
|
||||
struct_.struct_.set_status_text = response_set_status_text;
|
||||
struct_.struct_.get_mime_type = response_get_mime_type;
|
||||
struct_.struct_.set_mime_type = response_set_mime_type;
|
||||
struct_.struct_.get_header = response_get_header;
|
||||
struct_.struct_.get_header_map = response_get_header_map;
|
||||
struct_.struct_.set_header_map = response_set_header_map;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
Reference in New Issue
Block a user