From: uzair Date: Fri, 25 Sep 2020 12:57:43 +0000 (+0530) Subject: [M85 Dev] Add Page load callbacks on browser side X-Git-Tag: submit/tizen/20201118.160233~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba5a4439ba3d47ae8f7939272ecf4ab359858eed;p=platform%2Fframework%2Fweb%2Fchromium-efl.git [M85 Dev] Add Page load callbacks on browser side Below change adds missing implementations needed to inform browser process about load progress sent from renderer side. Change-Id: Ib0512734c57e15c9169fe4adc204b7520fe4d25c Signed-off-by: uzair --- diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc index 863985f..7037692 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc @@ -22,6 +22,7 @@ #include "content/public/browser/favicon_status.h" #include "content/public/browser/invalidate_type.h" #include "content/public/browser/navigation_entry.h" +#include "content/public/browser/navigation_handle.h" #include "eweb_view.h" #include "eweb_view_callbacks.h" #include "net/base/load_states.h" @@ -171,12 +172,18 @@ void WebContentsDelegateEfl::LoadingStateChanged(WebContents* source, web_view_->SmartCallback().call(); } -void WebContentsDelegateEfl::LoadProgressChanged(WebContents* source, - double progress) { +void WebContentsDelegateEfl::LoadProgressChanged(double progress) { web_view_->SetProgressValue(progress); web_view_->SmartCallback().call(&progress); } +void WebContentsDelegateEfl::DidStartNavigation( + NavigationHandle* navigation_handle) { + if (!navigation_handle->IsInMainFrame()) + return; + web_view_->SmartCallback().call(); +} + bool WebContentsDelegateEfl::ShouldCreateWebContents( WebContents* web_contents, RenderFrameHost* opener, diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h index 758bd6e..0686418 100644 --- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h +++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.h @@ -144,20 +144,20 @@ class WebContentsDelegateEfl : public WebContentsDelegate, bool PreHandleGestureEvent(WebContents* source, const blink::WebGestureEvent& event) override; + // IPC::Sender----------------------------------------------------------- + bool Send(IPC::Message* message) override; + // WebContentsObserver--------------------------------------------------- void DidFailLoad(RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code) override; - // IPC::Sender----------------------------------------------------------- - bool Send(IPC::Message* message) override; - // EWK_BRINGUP: These APIs are removed in upstream. void TitleWasSet(NavigationEntry* entry, bool explicit_set); - - void LoadProgressChanged(WebContents* source, double progress); + void DidStartNavigation(NavigationHandle* navigation_handle) override; + void LoadProgressChanged(double progress) override; void DidFinishLoad(RenderFrameHost* render_frame_host, - const GURL& validated_url); + const GURL& validated_url) override; void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host, const GURL& validated_url,