Send WEBVIEW_ERROR event after CEF finishing loading.
Currently, WEBVIEW_ERROR event is sent to client on CEF::OnLoadError(), which may cause the error message of wxInfoBar disapear. CEF::OnLoadEnd will be invoked after CEF::OnloadError, if WEBVIEW_ERROR event get processed before CEF::LoadEnd, the wxInfoBar's message will disappear since the webpage will get loaded in CEF::LoadEnd. CEF will return "data:text/html,chromewebdata" when url is invalid.
This commit is contained in:
parent
450bece977
commit
cd7df9c28b
2 changed files with 14 additions and 12 deletions
|
|
@ -39,7 +39,7 @@ class ClientHandler : public CefClient,
|
|||
public CefLoadHandler
|
||||
{
|
||||
public:
|
||||
ClientHandler() {};
|
||||
ClientHandler():m_loadErrorCode(-1) {};
|
||||
virtual ~ClientHandler() {};
|
||||
|
||||
virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() { return this; }
|
||||
|
|
@ -108,7 +108,9 @@ private:
|
|||
CefRefPtr<CefBrowser> m_browser;
|
||||
wxWebViewChromium *m_webview;
|
||||
int m_browserId;
|
||||
|
||||
// Record the load error code: enum wxWebViewNavigationError
|
||||
// -1 means no error.
|
||||
int m_loadErrorCode;
|
||||
IMPLEMENT_REFCOUNTING(ClientHandler);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue