- 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

@@ -24,6 +24,14 @@ int CefResponseCToCpp::GetStatus()
return struct_->get_status(struct_);
}
void CefResponseCToCpp::SetStatus(int status)
{
if(CEF_MEMBER_MISSING(struct_, set_status))
return;
struct_->set_status(struct_, status);
}
CefString CefResponseCToCpp::GetStatusText()
{
CefString str;
@@ -35,6 +43,33 @@ CefString CefResponseCToCpp::GetStatusText()
return str;
}
void CefResponseCToCpp::SetStatusText(const CefString& statusText)
{
if(CEF_MEMBER_MISSING(struct_, set_status_text))
return;
struct_->set_status_text(struct_, statusText.GetStruct());
}
CefString CefResponseCToCpp::GetMimeType()
{
CefString str;
if(CEF_MEMBER_MISSING(struct_, get_mime_type))
return str;
cef_string_userfree_t strPtr = struct_->get_mime_type(struct_);
str.AttachToUserFree(strPtr);
return str;
}
void CefResponseCToCpp::SetMimeType(const CefString& mimeType)
{
if(CEF_MEMBER_MISSING(struct_, set_mime_type))
return;
struct_->set_mime_type(struct_, mimeType.GetStruct());
}
CefString CefResponseCToCpp::GetHeader(const CefString& name)
{
CefString str;
@@ -60,6 +95,25 @@ void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap)
cef_string_map_free(map);
}
void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap)
{
if(CEF_MEMBER_MISSING(struct_, set_header_map))
return;
cef_string_map_t map = NULL;
if(!headerMap.empty()) {
map = cef_string_map_alloc();
if(!map)
return;
transfer_string_map_contents(headerMap, map);
}
struct_->set_header_map(struct_, map);
if(map)
cef_string_map_free(map);
}
#ifdef _DEBUG
template<> long CefCToCpp<CefResponseCToCpp, CefResponse,