- Code: Select all
var Request = new XMLHttpRequest();
Request.addEventListener("load", reqListener);
Request.open("GET", "client://myapp");
Request.send();
- Code: Select all
class MySchemeHandlerFactory : public CefSchemeHandlerFactory, public CefResourceHandler
{
public:
MySchemeHandlerFactory()
{
getchar();
}
virtual CefRefPtr<CefResourceHandler> Create(CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, const CefString& scheme_name, CefRefPtr< CefRequest > request) OVERRIDE
{
const std::string& html_content = "<html><body>Hello!< / body>< / html>";
// Create a stream reader for |html_content|.
CefRefPtr<CefStreamReader> stream =
CefStreamReader::CreateForData(
static_cast<void*>(const_cast<char*>(html_content.c_str())),
html_content.size());
// Constructor for HTTP status code 200 and no custom response headers.
// There’s also a version of the constructor for custom status code and response headers.
return new CefStreamResourceHandler("text/html", stream);
}
virtual void Cancel() OVERRIDE
{
}
virtual bool CanGetCookie(const CefCookie& cookie) OVERRIDE
{
return true;
}
virtual bool CanSetCookie(const CefCookie& cookie) OVERRIDE
{
return true;
}
virtual void GetResponseHeaders(CefRefPtr< CefResponse > response, int64& response_length, CefString& redirectUrl) OVERRIDE
{
}
virtual bool ProcessRequest(CefRefPtr< CefRequest > request, CefRefPtr< CefCallback > callback) OVERRIDE
{
return true;
}
virtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr< CefCallback > callback) OVERRIDE
{
return true;
}
IMPLEMENT_REFCOUNTING(MySchemeHandlerFactory);
};
Any help would be appreciated , thanks . There is something I'm just not getting.