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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 1832803002: Make EnableViewSourceMode a FrameMsg (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 RenderFrameHostImpl* render_frame_host = 850 RenderFrameHostImpl* render_frame_host =
851 frame_tree_node->render_manager()->GetFrameHostForNavigation( 851 frame_tree_node->render_manager()->GetFrameHostForNavigation(
852 *navigation_request); 852 *navigation_request);
853 853
854 // The renderer can exit view source mode when any error or cancellation 854 // The renderer can exit view source mode when any error or cancellation
855 // happen. When reusing the same renderer, overwrite to recover the mode. 855 // happen. When reusing the same renderer, overwrite to recover the mode.
856 if (navigation_request->is_view_source() && 856 if (navigation_request->is_view_source() &&
857 render_frame_host == 857 render_frame_host ==
858 frame_tree_node->render_manager()->current_frame_host()) { 858 frame_tree_node->render_manager()->current_frame_host()) {
859 DCHECK(!render_frame_host->GetParent()); 859 DCHECK(!render_frame_host->GetParent());
860 render_frame_host->render_view_host()->Send( 860 render_frame_host->Send(
861 new ViewMsg_EnableViewSourceMode( 861 new FrameMsg_EnableViewSourceMode(render_frame_host->GetRoutingID()));
862 render_frame_host->render_view_host()->GetRoutingID()));
863 } 862 }
864 863
865 CheckWebUIRendererDoesNotDisplayNormalURL( 864 CheckWebUIRendererDoesNotDisplayNormalURL(
866 render_frame_host, navigation_request->common_params().url); 865 render_frame_host, navigation_request->common_params().url);
867 866
868 navigation_request->TransferNavigationHandleOwnership(render_frame_host); 867 navigation_request->TransferNavigationHandleOwnership(render_frame_host);
869 render_frame_host->navigation_handle()->ReadyToCommitNavigation( 868 render_frame_host->navigation_handle()->ReadyToCommitNavigation(
870 render_frame_host, response ? response->head.headers : nullptr); 869 render_frame_host, response ? response->head.headers : nullptr);
871 render_frame_host->CommitNavigation(response, std::move(body), 870 render_frame_host->CommitNavigation(response, std::move(body),
872 navigation_request->common_params(), 871 navigation_request->common_params(),
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 if (pending_entry != controller_->GetVisibleEntry() || 1131 if (pending_entry != controller_->GetVisibleEntry() ||
1133 !should_preserve_entry) { 1132 !should_preserve_entry) {
1134 controller_->DiscardPendingEntry(true); 1133 controller_->DiscardPendingEntry(true);
1135 1134
1136 // Also force the UI to refresh. 1135 // Also force the UI to refresh.
1137 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); 1136 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
1138 } 1137 }
1139 } 1138 }
1140 1139
1141 } // namespace content 1140 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.cc » ('j') | content/common/frame_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698