- 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:
Marshall Greenblatt
2011-04-21 16:46:16 +00:00
parent f9c9c9318c
commit f18083e5df
25 changed files with 654 additions and 69 deletions

View File

@ -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