web_contents_observer.cc has new methods to watch navigation:
virtual void DidStartNavigation(NavigationHandle* navigation_handle) {}
virtual void DidRedirectNavigation(NavigationHandle* navigation_handle) {}
virtual void ReadyToCommitNavigation(NavigationHandle* navigation_handle) {}
virtual void DidFinishNavigation(NavigationHandle* navigation_handle) {}
they are a replacement for these deprecated methods that we currently watch in Java:
virtual void DidStartNavigationToPendingEntry(const GURL& url,
ReloadType reload_type) {}
virtual void DidStartProvisionalLoadForFrame(
RenderFrameHost* render_frame_host,
const GURL& validated_url,
bool is_error_page) {}
virtual void DidCommitProvisionalLoadForFrame(
RenderFrameHost* render_frame_host,
const GURL& url,
ui::PageTransition transition_type) {}
virtual void DidFailProvisionalLoad(
RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) {}
virtual void DidNavigateMainFrame(
const LoadCommittedDetails& details,
const FrameNavigateParams& params) {}
virtual void DidNavigateAnyFrame(
RenderFrameHost* render_frame_host,
const LoadCommittedDetails& details,
const FrameNavigateParams& params) {}
We need to update WebContentsObserver.java to provide API for observing web contents through new methods and update the current observers to use the new methods.
These methods should work correctly both with and without PlzNavigate feature enabled, but to test with PlzNavigate, use --enable-browser-side-navigation switch.
Also, here's the design doc for the new API: https://docs.google.com/document/d/1ICLLQoC9EsZ-bWH4ZKRhPCIoZKn6pOj02SlGl6SKH6Y/edit#heading=h.fmxjmgvbgg7x
Comment 1 by bugdroid1@chromium.org
, Jan 7 2017