delete metafile;
}
+static bool IsMainFrame(RenderFrameHost* render_frame_host) {
+ return !render_frame_host->GetParent();
+}
+
#if BUILDFLAG(IS_TIZEN) && defined(TIZEN_MULTIMEDIA_SUPPORT)
static const MediaStreamDevice* GetRequestedVideoDevice(
const std::string& device_id) {
web_view_->SmartCallback<EWebViewCallbacks::LoadProgress>().call(&progress);
}
-void WebContentsDelegateEfl::DidStartNavigation(
- NavigationHandle* navigation_handle) {
- if (!navigation_handle->IsInMainFrame())
- return;
- web_view_->SmartCallback<EWebViewCallbacks::ProvisionalLoadStarted>().call();
-}
-
void WebContentsDelegateEfl::AddNewContents(
WebContents* source,
std::unique_ptr<WebContents> new_contents,
web_view_->InvokeAuthCallback(login_delegate, url, realm);
}
-void WebContentsDelegateEfl::DidStartProvisionalLoadForFrame(
- RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- bool is_error_page,
- bool is_iframe_srcdoc) {
+void WebContentsDelegateEfl::DidStartNavigation(
+ NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame())
+ return;
web_view_->SmartCallback<EWebViewCallbacks::ProvisionalLoadStarted>().call();
}
-void WebContentsDelegateEfl::DidCommitProvisionalLoadForFrame(
- RenderFrameHost* render_frame_host,
- const GURL& url,
- ui::PageTransition transition_type) {
- web_view_->SmartCallback<EWebViewCallbacks::LoadCommitted>().call();
+void WebContentsDelegateEfl::DidRedirectNavigation(
+ NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame())
+ return;
+ web_view_->SmartCallback<EWebViewCallbacks::ProvisionalLoadRedirect>().call();
}
-void WebContentsDelegateEfl::DidNavigateMainFrame(
- const LoadCommittedDetails& details) {
- // The condition checks whether the main frame navigated to a different page,
- // not scrolled to a fragment inside the current page.
- if (details.is_navigation_to_different_page())
- web_view_->SmartCallback<EWebViewCallbacks::LoadStarted>().call();
-}
+void WebContentsDelegateEfl::DidFinishNavigation(
+ NavigationHandle* navigation_handle) {
+ if (!navigation_handle->HasCommitted())
+ return;
-void WebContentsDelegateEfl::DocumentOnLoadCompletedInMainFrame() {
- web_view_->SmartCallback<EWebViewCallbacks::LoadFinished>().call();
-}
+ if (navigation_handle->IsInMainFrame()) {
+ web_view_->SmartCallback<EWebViewCallbacks::LoadCommitted>().call();
-#if !defined(EWK_BRINGUP) // FIXME: m94 bringup
-void WebContentsDelegateEfl::DidNavigateAnyFrame(
- RenderFrameHost* render_frame_host,
- const LoadCommittedDetails& details,
- const FrameNavigateParams& params) {
- web_view_->SmartCallback<EWebViewCallbacks::ProvisionalLoadRedirect>().call();
- static_cast<BrowserContextEfl*>(web_contents_.GetBrowserContext())
- ->AddVisitedURLs(params.redirects);
+ if (!navigation_handle->IsSameDocument() &&
+ !navigation_handle->IsErrorPage())
+ web_view_->SmartCallback<EWebViewCallbacks::LoadStarted>().call();
+ } else if (!navigation_handle->HasSubframeNavigationEntryCommitted()) {
+ return;
+ }
+
+ if (navigation_handle->ShouldUpdateHistory())
+ static_cast<BrowserContextEfl*>(web_contents_.GetBrowserContext())
+ ->AddVisitedURLs(navigation_handle->GetRedirectChain());
}
-#endif
void WebContentsDelegateEfl::DidFinishLoad(RenderFrameHost* render_frame_host,
const GURL& validated_url) {
- if (render_frame_host->GetParent())
+ if (!IsMainFrame(render_frame_host))
return;
+ web_view_->SmartCallback<EWebViewCallbacks::LoadFinished>().call();
NavigationEntry* entry = web_contents().GetController().GetVisibleEntry();
if (!entry)
web_contents_.Focus();
}
+void WebContentsDelegateEfl::DidFailLoad(RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code) {
+ if (!IsMainFrame(render_frame_host))
+ return;
+
+ web_view_->InvokeLoadError(validated_url, error_code, std::string());
+}
+
void WebContentsDelegateEfl::DidUpdateFaviconURL(
RenderFrameHost* render_frame_host,
const std::vector<blink::mojom::FaviconURLPtr>& candidates) {
return handled;
}
-void WebContentsDelegateEfl::DidFailProvisionalLoad(
- RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- int error_code,
- const std::u16string& error_description,
- bool /*was_ignored_by_handler*/) {
- DidFailLoad(render_frame_host, validated_url, error_code);
-}
-
-void WebContentsDelegateEfl::DidFailLoad(RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- int error_code) {
- bool is_main_frame = !render_frame_host->GetParent();
- web_view_->InvokeLoadError(validated_url, error_code, std::string(),
- is_main_frame);
-}
-
bool WebContentsDelegateEfl::Send(IPC::Message* message) {
if (!web_contents_.GetRenderViewHost()) {
delete message;
return false;
}
-void WebContentsDelegateEfl::TitleWasSet(NavigationEntry* entry,
- bool /*explicit_set*/) {
+void WebContentsDelegateEfl::TitleWasSet(NavigationEntry* entry) {
if (entry)
web_view_->GetBackForwardList()->UpdateItemWithEntry(entry);
}
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;
-
- // EWK_BRINGUP: These APIs are removed in upstream.
- void TitleWasSet(NavigationEntry* entry, bool explicit_set);
void DidStartNavigation(NavigationHandle* navigation_handle) override;
+
+ void DidRedirectNavigation(NavigationHandle* navigation_handle) override;
+
+ void DidFinishNavigation(NavigationHandle* navigation_handle) override;
+
void LoadProgressChanged(double progress) override;
void DidFinishLoad(RenderFrameHost* render_frame_host,
const GURL& validated_url) override;
- void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- bool is_error_page,
- bool is_iframe_srcdoc);
+ void DidFailLoad(RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code) override;
void DidUpdateFaviconURL(
RenderFrameHost* render_frame_host,
const std::vector<blink::mojom::FaviconURLPtr>& candidates) override;
- void DidCommitProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
- const GURL& url,
- ui::PageTransition transition_type);
-
- void DidNavigateMainFrame(const LoadCommittedDetails& details);
- void DocumentOnLoadCompletedInMainFrame();
-#if !defined(EWK_BRINGUP) // FIXME: m94 bringup
- void DidNavigateAnyFrame(RenderFrameHost* render_frame_host,
- const LoadCommittedDetails& details,
- const FrameNavigateParams& params);
-#endif
- void DidFailProvisionalLoad(RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- int error_code,
- const std::u16string& error_description,
- bool was_ignored_by_handler);
- // EWK_BRINGUP end.
+ void TitleWasSet(content::NavigationEntry* entry) override;
void OnAuthRequired(const std::string& realm,
const GURL& url,
LoginDelegateEfl* login_delegate);
+ // IPC::Sender-----------------------------------------------------------
+ bool Send(IPC::Message* message) override;
+
void DidDownloadFavicon(bool success,
const GURL& icon_url,
const SkBitmap& bitmap);