@@ -668,8 +668,6 @@ class MCCefBrowserClient : public CefClient, CefLifeSpanHandler, CefRequestHandl
668668 t_url_str = nil;
669669 /* UNCHECKED */ MCCefStringToUtf8String (t_url, t_url_str);
670670
671- m_owner->OnNavigationBegin (!p_frame->IsMain (), t_url_str);
672-
673671 if (t_url_str != nil)
674672 MCCStringFree (t_url_str);
675673
@@ -791,7 +789,13 @@ class MCCefBrowserClient : public CefClient, CefLifeSpanHandler, CefRequestHandl
791789 t_url_str = nil;
792790 /* UNCHECKED */ MCCefStringToUtf8String (t_url, t_url_str);
793791
794- m_owner->OnNavigationComplete (!p_frame->IsMain (), t_url_str);
792+ bool t_frame;
793+ t_frame = !p_frame->IsMain ();
794+
795+ if (!t_frame)
796+ m_owner->OnNavigationBegin (t_frame, t_url_str);
797+
798+ m_owner->OnDocumentLoadBegin (t_frame, t_url_str);
795799
796800 if (t_url_str != nil)
797801 MCCStringFree (t_url_str);
@@ -808,8 +812,6 @@ class MCCefBrowserClient : public CefClient, CefLifeSpanHandler, CefRequestHandl
808812 bool t_is_error;
809813 t_is_error = RemoveLoadErrorFrame (p_frame->GetIdentifier (), t_url, t_error);
810814
811- /* TODO - Load error handling */
812- // For now we don't send a browser load error message - instead make sure documentComplete is sent with the correct url
813815 if (!t_is_error)
814816 t_url = p_frame->GetURL ();
815817
@@ -820,29 +822,37 @@ class MCCefBrowserClient : public CefClient, CefLifeSpanHandler, CefRequestHandl
820822 t_url_str = nil;
821823 /* UNCHECKED */ MCCefStringToUtf8String (t_url, t_url_str);
822824
825+ bool t_frame;
826+ t_frame = !p_frame->IsMain ();
827+
823828 if (t_is_error)
824829 {
825830 char *t_err_str;
826831 t_err_str = nil;
827832 /* UNCHECKED */ MCCefStringToUtf8String (t_error, t_err_str);
828833
829- m_owner->OnDocumentLoadFailed (!p_frame->IsMain (), t_url_str, t_err_str);
834+ m_owner->OnDocumentLoadFailed (t_frame, t_url_str, t_err_str);
835+
836+ if (!t_frame)
837+ m_owner->OnNavigationFailed (t_frame, t_url_str, t_err_str);
830838
831839 if (t_err_str != nil)
832840 MCCStringFree (t_err_str);
833841 }
834842 else
835- m_owner->OnDocumentLoadComplete (!p_frame->IsMain (), t_url_str);
843+ {
844+ m_owner->OnDocumentLoadComplete (t_frame, t_url_str);
845+
846+ if (!t_frame)
847+ m_owner->OnNavigationComplete (t_frame, t_url_str);
848+ }
836849
837850 if (t_url_str != nil)
838851 MCCStringFree (t_url_str);
839852 }
840853
841854 virtual void OnLoadError (CefRefPtr<CefBrowser> p_browser, CefRefPtr<CefFrame> p_frame, CefLoadHandler::ErrorCode p_error_code, const CefString &p_error_text, const CefString &p_failed_url) OVERRIDE
842855 {
843- if (IgnoreUrl (p_failed_url))
844- return ;
845-
846856 AddLoadErrorFrame (p_frame->GetIdentifier (), p_failed_url, p_error_text);
847857 }
848858
0 commit comments