Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1700)

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 1035983002: PlzNavigate: Send EnableViewSourceMode at commit time when reusing a RFH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 13f2efa1f5c92c054e070da9e1d5590ecf05172b..d6ac418ebe47f48e932a2586a535d63b922cdaf3 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -702,6 +702,18 @@ void NavigatorImpl::CommitNavigation(FrameTreeNode* frame_tree_node,
RenderFrameHostImpl* render_frame_host =
frame_tree_node->render_manager()->GetFrameHostForNavigation(
*navigation_request);
+
+ // The renderer can exit view source mode when any error or cancellation
+ // happen. When reusing the same renderer, overwrite to recover the mode.
+ if (navigation_request->is_view_source() &&
+ render_frame_host ==
+ frame_tree_node->render_manager()->current_frame_host()) {
+ DCHECK(!render_frame_host->GetParent());
+ render_frame_host->render_view_host()->Send(
+ new ViewMsg_EnableViewSourceMode(
+ render_frame_host->render_view_host()->GetRoutingID()));
+ }
+
CheckWebUIRendererDoesNotDisplayNormalURL(
render_frame_host, navigation_request->common_params().url);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698