From 2b6285b7013d7d00e7244edcc91a1ff1ab13f58c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 12 Sep 2013 17:27:59 +0000 Subject: [PATCH] - Only update back/forward state for committed navigations. - Don't change the frame URL for failed loads. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1437 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/browser_host_impl.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 1331b365a..13b9b64d0 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -1448,7 +1448,8 @@ content::WebContents* CefBrowserHostImpl::OpenURLFromTab( } void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source) { - int current_index = web_contents_->GetController().GetCurrentEntryIndex(); + int current_index = + web_contents_->GetController().GetLastCommittedEntryIndex(); int max_index = web_contents_->GetController().GetEntryCount() - 1; bool is_loading, can_go_back, can_go_forward; @@ -1868,7 +1869,7 @@ void CefBrowserHostImpl::DidFailProvisionalLoad( content::RenderViewHost* render_view_host) { CefRefPtr frame = GetOrCreateFrame(frame_id, CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(), - validated_url); + GURL()); OnLoadError(frame, validated_url, error_code, error_description); }