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:
@ -29,7 +29,8 @@ public:
|
||||
// specified number of bytes have been read. If there is a response set
|
||||
// |mime_type| to the mime type for the response.
|
||||
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
|
||||
CefString& mime_type, int* response_length)
|
||||
CefRefPtr<CefResponse> response,
|
||||
int* response_length)
|
||||
{
|
||||
REQUIRE_IO_THREAD();
|
||||
|
||||
@ -60,7 +61,8 @@ public:
|
||||
handled = true;
|
||||
|
||||
// Set the resulting mime type
|
||||
mime_type = "text/html";
|
||||
response->SetMimeType("text/html");
|
||||
response->SetStatus(200);
|
||||
}
|
||||
else if(strstr(url.c_str(), "client.png") != NULL) {
|
||||
// Load the response image
|
||||
@ -70,7 +72,9 @@ public:
|
||||
if(LoadBinaryResource(IDS_LOGO, dwSize, pBytes)) {
|
||||
data_ = std::string(reinterpret_cast<const char*>(pBytes), dwSize);
|
||||
handled = true;
|
||||
mime_type = "image/png";
|
||||
// Set the resulting mime type
|
||||
response->SetMimeType("image/jpg");
|
||||
response->SetStatus(200);
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
if(LoadBinaryResource("logo.png", data_)) {
|
||||
|
Reference in New Issue
Block a user