PlzNavigate: Use WebNavigationPolicyHandledByClient

When PlzNavigate is enabled, this CL has
RenderFrameImpl::decidePolicyForNavigation return
WebNavigationPolicyHandledByClient when the navigation is sent ot the browser.
Before it would return WebNavigationPolicyIgnore, which would result in an
incorrect tracking of load state in the renderer.

BUG=576265
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review URL: https://codereview.chromium.org/1608283002

Cr-Commit-Position: refs/heads/master@{#376761}
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index 7dfb6dd..542adfe6 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -313,6 +313,7 @@
   CHECK(IsBrowserSideNavigationEnabled());
   if (!navigation_request_)
     return;
+  bool was_renderer_initiated = !navigation_request_->browser_initiated();
   navigation_request_.reset();
 
   if (keep_state)
@@ -322,6 +323,14 @@
   // it created for the navigation. Also register that the load stopped.
   DidStopLoading();
   render_manager_.CleanUpNavigation();
+
+  // If the navigation is renderer-initiated, the renderer should also be
+  // informed that the navigation stopped.
+  if (was_renderer_initiated) {
+    current_frame_host()->Send(
+        new FrameMsg_Stop(current_frame_host()->GetRoutingID()));
+  }
+
 }
 
 bool FrameTreeNode::has_started_loading() const {