Move NavigationRequest creation to NavigationController: 2/3

This CL moves the NavigationRequest creation to the NavigationController. The
Navigator will now take a NavigationRequest as an argument to Navigate instead
of the pending NavigationEntry.

Summary of the changes:
1) Navigator
 - NavigatorImpl::NavigateToEntry and NavigatorImpl::NavigateToPendingEntry are
   removed in favor of Navigate which takes as argument a NavigationRequest. The
   NavigationController is now responsible for creating the NavigationRequest and
   passing it to Navigator::Navigate to have the navigation start.
 - NavigatorImpl::RequestNavigation, which currently creates the
   NavigationRequest is removed. Instead, the NavigationRequest is created in
   NavigationControllerImpl::CreateNavigationRequest.

2) NavigationController
 - HandleRendererDebugURL is called from NavigateWithoutEntry and handles
   navigation to a renderer debug URL. Navigations to a renderer debug URL do not
   require a NavigationRequest. They cannot commit, hence why we can't have a
   committed NavigationEntry for a renderer debug URL.

The next CLs will cleanup the internals of NavigationController.

Bug: 803365
Change-Id: I8b01384324ccfdca451baf1e645ac7d0869e8d47
Reviewed-on: https://chromium-review.googlesource.com/957735
Commit-Queue: Camille Lamy <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Cr-Commit-Position: refs/heads/master@{#562250}
diff --git a/content/browser/frame_host/navigator_impl.h b/content/browser/frame_host/navigator_impl.h
index 21557ba..82ab71a1 100644
--- a/content/browser/frame_host/navigator_impl.h
+++ b/content/browser/frame_host/navigator_impl.h
@@ -57,25 +57,12 @@
                    const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
                    std::unique_ptr<NavigationHandleImpl> navigation_handle,
                    bool was_within_same_document) override;
-  bool NavigateToPendingEntry(
-      FrameTreeNode* frame_tree_node,
-      const FrameNavigationEntry& frame_entry,
-      ReloadType reload_type,
-      bool is_same_document_history_load,
-      std::unique_ptr<NavigationUIData> navigation_ui_data) override;
-  bool NavigateToEntry(
-      FrameTreeNode* frame_tree_node,
-      const FrameNavigationEntry& frame_entry,
-      const NavigationEntryImpl& entry,
-      ReloadType reload_type,
-      bool is_same_document_history_load,
-      bool is_history_navigation_in_new_child,
-      bool is_pending_entry,
-      const scoped_refptr<network::ResourceRequestBody>& post_body,
-      std::unique_ptr<NavigationUIData> navigation_ui_data) override;
   bool StartHistoryNavigationInNewSubframe(
       RenderFrameHostImpl* render_frame_host,
       const GURL& default_url) override;
+  void Navigate(std::unique_ptr<NavigationRequest> request,
+                ReloadType reload_type,
+                RestoreType restore_type) override;
   void RequestOpenURL(RenderFrameHostImpl* render_frame_host,
                       const GURL& url,
                       bool uses_post,
@@ -127,22 +114,6 @@
   friend class NavigatorTestWithBrowserSideNavigation;
   ~NavigatorImpl() override;
 
-  // If needed, sends a BeforeUnload IPC to the renderer to ask it to execute
-  // the beforeUnload event. Otherwise, the navigation request will be started.
-  void RequestNavigation(
-      FrameTreeNode* frame_tree_node,
-      const GURL& dest_url,
-      const Referrer& dest_referrer,
-      const FrameNavigationEntry& frame_entry,
-      const NavigationEntryImpl& entry,
-      ReloadType reload_type,
-      PreviewsState previews_state,
-      bool is_same_document_history_load,
-      bool is_history_navigation_in_new_child,
-      const scoped_refptr<network::ResourceRequestBody>& post_body,
-      base::TimeTicks navigation_start,
-      std::unique_ptr<NavigationUIData> navigation_ui_data);
-
   void RecordNavigationMetrics(
       const LoadCommittedDetails& details,
       const FrameHostMsg_DidCommitProvisionalLoad_Params& params,