Chromium Code Reviews| Index: content/browser/frame_host/render_frame_host_impl.cc |
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc |
| index 2a2c63a4156bf07ff0b9566d099387c41b9a72ce..ef9e8a3387729f688f7e31ed86f8d86eac50b809 100644 |
| --- a/content/browser/frame_host/render_frame_host_impl.cc |
| +++ b/content/browser/frame_host/render_frame_host_impl.cc |
| @@ -58,6 +58,7 @@ |
| #include "content/common/render_frame_setup.mojom.h" |
| #include "content/common/site_isolation_policy.h" |
| #include "content/common/swapped_out_messages.h" |
| +#include "content/common/view_messages.h" |
|
nasko
2016/03/18 21:51:43
This makes me sad. RenderFrame(Host) objects shoul
clamy
2016/03/23 14:36:44
Done.
|
| #include "content/public/browser/ax_event_notification_details.h" |
| #include "content/public/browser/browser_accessibility_state.h" |
| #include "content/public/browser/browser_context.h" |
| @@ -2006,8 +2007,8 @@ void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { |
| FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, |
| base::TimeTicks::Now(), "GET"); |
| if (IsBrowserSideNavigationEnabled()) { |
| - CommitNavigation(nullptr, nullptr, common_params, |
| - RequestNavigationParams()); |
| + CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), |
| + false); |
| } else { |
| Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); |
| } |
| @@ -2137,7 +2138,8 @@ void RenderFrameHostImpl::CommitNavigation( |
| ResourceResponse* response, |
| scoped_ptr<StreamHandle> body, |
| const CommonNavigationParams& common_params, |
| - const RequestNavigationParams& request_params) { |
| + const RequestNavigationParams& request_params, |
| + bool is_view_source) { |
| DCHECK((response && body.get()) || |
| !ShouldMakeNetworkRequestForURL(common_params.url)); |
| UpdatePermissionsForNavigation(common_params, request_params); |
| @@ -2146,6 +2148,15 @@ void RenderFrameHostImpl::CommitNavigation( |
| // completing a RFH swap or unload handler. |
| SetState(RenderFrameHostImpl::STATE_DEFAULT); |
| + // The renderer can exit view source mode when any error or cancellation |
| + // happen. When reusing the same renderer, overwrite to recover the mode. |
| + if (is_view_source && |
| + this == frame_tree_node_->render_manager()->current_frame_host()) { |
| + DCHECK(!GetParent()); |
| + render_view_host()->Send( |
| + new ViewMsg_EnableViewSourceMode(render_view_host()->GetRoutingID())); |
|
nasko
2016/03/18 21:51:43
View source can never have subframes. Why not move
clamy
2016/03/23 14:36:44
Done. This adds a bit more changes though.
nasko
2016/03/23 22:16:46
This could always be landed as a small separate CL
|
| + } |
| + |
| const GURL body_url = body.get() ? body->GetURL() : GURL(); |
| const ResourceResponseHead head = response ? |
| response->head : ResourceResponseHead(); |
| @@ -2163,7 +2174,6 @@ void RenderFrameHostImpl::CommitNavigation( |
| if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) { |
| pending_commit_ = true; |
| is_loading_ = true; |
| - frame_tree_node_->ResetNavigationRequest(true); |
| } |
| } |