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

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 6d58505185807b14b61349d410857ce217e11ebf..0d1d03aa60eb246e0eae107162c62549fd8c3da6 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -697,6 +697,17 @@ 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.
clamy 2015/03/26 16:15:13 Note that this cannot happen in GetFrameHostForNav
nasko 2015/03/26 20:46:31 Acknowledged.
+ if (navigation_request->is_view_source() &&
+ render_frame_host ==
+ frame_tree_node->render_manager()->current_frame_host()) {
+ render_frame_host->render_view_host()->Send(
nasko 2015/03/26 20:46:31 We should (D)CHECK here that the RFH is the top-le
clamy 2015/03/27 10:53:12 Done.
+ 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