mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Pass HTTP status code to HandleLoadEnd (issue #177).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@173 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -626,7 +626,8 @@ public:
|
|||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
bool isMainContent) =0;
|
bool isMainContent,
|
||||||
|
int httpStatusCode) =0;
|
||||||
|
|
||||||
// Supported error code values. See net\base\net_error_list.h for complete
|
// Supported error code values. See net\base\net_error_list.h for complete
|
||||||
// descriptions of the error codes.
|
// descriptions of the error codes.
|
||||||
|
@ -442,7 +442,7 @@ typedef struct _cef_handler_t
|
|||||||
// The return value is currently ignored.
|
// The return value is currently ignored.
|
||||||
enum cef_retval_t (CEF_CALLBACK *handle_load_end)(struct _cef_handler_t* self,
|
enum cef_retval_t (CEF_CALLBACK *handle_load_end)(struct _cef_handler_t* self,
|
||||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||||
int isMainContent);
|
int isMainContent, int httpStatusCode);
|
||||||
|
|
||||||
// Called when the browser fails to load a resource. |errorCode| is the error
|
// Called when the browser fails to load a resource. |errorCode| is the error
|
||||||
// code number and |failedUrl| is the URL that failed to load. To provide
|
// code number and |failedUrl| is the URL that failed to load. To provide
|
||||||
|
@ -924,8 +924,10 @@ void BrowserWebViewDelegate::LocationChangeDone(WebFrame* frame) {
|
|||||||
|
|
||||||
if(handler.get()) {
|
if(handler.get()) {
|
||||||
// Notify the handler that loading has ended.
|
// Notify the handler that loading has ended.
|
||||||
|
int httpStatusCode = frame->dataSource()->response().httpStatusCode();
|
||||||
handler->HandleLoadEnd(browser_,
|
handler->HandleLoadEnd(browser_,
|
||||||
(is_top_frame) ? NULL : browser_->GetCefFrame(frame), is_main_content_);
|
(is_top_frame) ? NULL : browser_->GetCefFrame(frame), is_main_content_,
|
||||||
|
httpStatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_top_frame && is_main_content_)
|
if (is_top_frame && is_main_content_)
|
||||||
|
@ -153,7 +153,7 @@ enum cef_retval_t CEF_CALLBACK handler_handle_load_start(
|
|||||||
|
|
||||||
enum cef_retval_t CEF_CALLBACK handler_handle_load_end(
|
enum cef_retval_t CEF_CALLBACK handler_handle_load_end(
|
||||||
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
|
||||||
int isMainContent)
|
int isMainContent, int httpStatusCode)
|
||||||
{
|
{
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
DCHECK(browser);
|
DCHECK(browser);
|
||||||
@ -165,7 +165,8 @@ enum cef_retval_t CEF_CALLBACK handler_handle_load_end(
|
|||||||
framePtr = CefFrameCToCpp::Wrap(frame);
|
framePtr = CefFrameCToCpp::Wrap(frame);
|
||||||
|
|
||||||
return CefHandlerCppToC::Get(self)->HandleLoadEnd(
|
return CefHandlerCppToC::Get(self)->HandleLoadEnd(
|
||||||
CefBrowserCToCpp::Wrap(browser), framePtr, isMainContent?true:false);
|
CefBrowserCToCpp::Wrap(browser), framePtr,
|
||||||
|
isMainContent?true:false, httpStatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum cef_retval_t CEF_CALLBACK handler_handle_load_error(
|
enum cef_retval_t CEF_CALLBACK handler_handle_load_error(
|
||||||
|
@ -114,7 +114,7 @@ CefHandler::RetVal CefHandlerCToCpp::HandleLoadStart(
|
|||||||
|
|
||||||
CefHandler::RetVal CefHandlerCToCpp::HandleLoadEnd(
|
CefHandler::RetVal CefHandlerCToCpp::HandleLoadEnd(
|
||||||
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||||
bool isMainContent)
|
bool isMainContent, int httpStatusCode)
|
||||||
{
|
{
|
||||||
if(CEF_MEMBER_MISSING(struct_, handle_load_end))
|
if(CEF_MEMBER_MISSING(struct_, handle_load_end))
|
||||||
return RV_CONTINUE;
|
return RV_CONTINUE;
|
||||||
@ -124,7 +124,7 @@ CefHandler::RetVal CefHandlerCToCpp::HandleLoadEnd(
|
|||||||
frameStruct = CefFrameCppToC::Wrap(frame);
|
frameStruct = CefFrameCppToC::Wrap(frame);
|
||||||
|
|
||||||
return struct_->handle_load_end(struct_, CefBrowserCppToC::Wrap(browser),
|
return struct_->handle_load_end(struct_, CefBrowserCppToC::Wrap(browser),
|
||||||
frameStruct, isMainContent);
|
frameStruct, isMainContent, httpStatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
CefHandler::RetVal CefHandlerCToCpp::HandleLoadError(
|
CefHandler::RetVal CefHandlerCToCpp::HandleLoadError(
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
virtual RetVal HandleLoadStart(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadStart(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame, bool isMainContent);
|
CefRefPtr<CefFrame> frame, bool isMainContent);
|
||||||
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame, bool isMainContent);
|
CefRefPtr<CefFrame> frame, bool isMainContent, int httpStatusCode);
|
||||||
virtual RetVal HandleLoadError(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadError(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame, ErrorCode errorCode,
|
CefRefPtr<CefFrame> frame, ErrorCode errorCode,
|
||||||
const CefString& failedUrl, CefString& errorText);
|
const CefString& failedUrl, CefString& errorText);
|
||||||
|
@ -75,7 +75,7 @@ CefHandler::RetVal ClientHandler::HandleLoadStart(CefRefPtr<CefBrowser> browser,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CefHandler::RetVal ClientHandler::HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
CefHandler::RetVal ClientHandler::HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame, bool isMainContent)
|
CefRefPtr<CefFrame> frame, bool isMainContent, int httpStatusCode)
|
||||||
{
|
{
|
||||||
if(!browser->IsPopup() && !frame.get())
|
if(!browser->IsPopup() && !frame.get())
|
||||||
{
|
{
|
||||||
@ -90,8 +90,8 @@ CefHandler::RetVal ClientHandler::HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CefHandler::RetVal ClientHandler::HandleLoadError(CefRefPtr<CefBrowser> browser,
|
CefHandler::RetVal ClientHandler::HandleLoadError(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame, ErrorCode errorCode,
|
CefRefPtr<CefFrame> frame, ErrorCode errorCode, const CefString& failedUrl,
|
||||||
const CefString& failedUrl, CefString& errorText)
|
CefString& errorText)
|
||||||
{
|
{
|
||||||
if(errorCode == ERR_CACHE_MISS)
|
if(errorCode == ERR_CACHE_MISS)
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,8 @@ public:
|
|||||||
// return value is currently ignored.
|
// return value is currently ignored.
|
||||||
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
bool isMainContent);
|
bool isMainContent,
|
||||||
|
int httpStatusCode);
|
||||||
|
|
||||||
// Called when the browser fails to load a resource. |errorCode| is the
|
// Called when the browser fails to load a resource. |errorCode| is the
|
||||||
// error code number and |failedUrl| is the URL that failed to load. To
|
// error code number and |failedUrl| is the URL that failed to load. To
|
||||||
|
@ -273,7 +273,8 @@ public:
|
|||||||
|
|
||||||
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
bool isMainContent)
|
bool isMainContent,
|
||||||
|
int httpStatusCode)
|
||||||
{
|
{
|
||||||
if(!browser->IsPopup() && !frame.get())
|
if(!browser->IsPopup() && !frame.get())
|
||||||
DestroyTest();
|
DestroyTest();
|
||||||
@ -382,7 +383,8 @@ public:
|
|||||||
|
|
||||||
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
bool isMainContent)
|
bool isMainContent,
|
||||||
|
int httpStatusCode)
|
||||||
{
|
{
|
||||||
if(!browser->IsPopup() && !frame.get())
|
if(!browser->IsPopup() && !frame.get())
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,8 @@ public:
|
|||||||
|
|
||||||
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
bool isMainContent)
|
bool isMainContent,
|
||||||
|
int httpStatusCode)
|
||||||
{
|
{
|
||||||
return RV_CONTINUE;
|
return RV_CONTINUE;
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,8 @@ public:
|
|||||||
|
|
||||||
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||||
CefRefPtr<CefFrame> frame,
|
CefRefPtr<CefFrame> frame,
|
||||||
bool isMainContent)
|
bool isMainContent,
|
||||||
|
int httpStatusCode)
|
||||||
{
|
{
|
||||||
if(!browser->IsPopup() && !frame.get())
|
if(!browser->IsPopup() && !frame.get())
|
||||||
DestroyTest();
|
DestroyTest();
|
||||||
|
Reference in New Issue
Block a user