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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user