#define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_
#include "base/memory/ref_counted.h"
+#include "base/time/time.h"
#include "content/common/content_export.h"
#include "content/public/browser/navigation_controller.h"
#include "ui/base/window_open_disposition.h"
class GURL;
+struct FrameHostMsg_BeginNavigation_Params;
struct FrameHostMsg_DidCommitProvisionalLoad_Params;
struct FrameHostMsg_DidFailProvisionalLoadWithError_Params;
namespace content {
+class FrameTreeNode;
class NavigationControllerImpl;
class NavigationEntryImpl;
+class NavigationRequest;
class NavigatorDelegate;
class RenderFrameHostImpl;
+class StreamHandle;
+struct CommonNavigationParams;
+struct ResourceResponse;
// Implementations of this interface are responsible for performing navigations
// in a node of the FrameTree. Its lifetime is bound to all FrameTreeNode
// Returns the NavigationController associated with this Navigator.
virtual NavigationController* GetController();
-
// Notifications coming from the RenderFrameHosts ----------------------------
// The RenderFrameHostImpl started a provisional load.
virtual void DidStartProvisionalLoad(RenderFrameHostImpl* render_frame_host,
- int parent_routing_id,
- const GURL& url) {};
+ const GURL& url,
+ bool is_transition_navigation) {};
// The RenderFrameHostImpl has failed a provisional load.
virtual void DidFailProvisionalLoadWithError(
int error_code,
const base::string16& error_description) {}
- // The RenderFrameHostImpl processed a redirect during a provisional load.
- //
- // TODO(creis): Remove this method and have the pre-rendering code listen to
- // WebContentsObserver::DidGetRedirectForResourceRequest instead.
- // See http://crbug.com/78512.
- virtual void DidRedirectProvisionalLoad(
- RenderFrameHostImpl* render_frame_host,
- int32 page_id,
- const GURL& source_url,
- const GURL& target_url) {}
-
// The RenderFrameHostImpl has committed a navigation.
virtual void DidNavigate(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
const std::vector<GURL>& redirect_chain,
const Referrer& referrer,
- PageTransition page_transition,
+ ui::PageTransition page_transition,
WindowOpenDisposition disposition,
const GlobalRequestID& transferred_global_request_id,
bool should_replace_current_entry,
bool user_gesture) {}
+ // PlzNavigate: Used to start a navigation. OnBeginNavigation is called
+ // directly by RequestNavigation when there is no live renderer. Otherwise, it
+ // is called following a BeginNavigation IPC from the renderer (which in
+ // browser-initiated navigation also happens after RequestNavigation has been
+ // called).
+ virtual void OnBeginNavigation(
+ FrameTreeNode* frame_tree_node,
+ const FrameHostMsg_BeginNavigation_Params& params,
+ const CommonNavigationParams& common_params) {}
+
+ // PlzNavigate
+ // Signal |render_frame_host| that a navigation is ready to commit (the
+ // response to the navigation request has been received).
+ virtual void CommitNavigation(FrameTreeNode* frame_tree_node,
+ ResourceResponse* response,
+ scoped_ptr<StreamHandle> body);
+
+ // PlzNavigate
+ // Cancel a NavigationRequest for |frame_tree_node|. Called when
+ // |frame_tree_node| is destroyed.
+ virtual void CancelNavigation(FrameTreeNode* frame_tree_node) {}
+
+ // Called when the first resource request for a given navigation is executed
+ // so that it can be tracked into an histogram.
+ virtual void LogResourceRequestTime(
+ base::TimeTicks timestamp, const GURL& url) {};
+
+ // Called to record the time it took to execute the before unload hook for the
+ // current navigation.
+ virtual void LogBeforeUnloadTime(
+ const base::TimeTicks& renderer_before_unload_start_time,
+ const base::TimeTicks& renderer_before_unload_end_time) {}
+
protected:
friend class base::RefCounted<Navigator>;
virtual ~Navigator() {}