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

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

Issue 789643005: PlzNavigate: make content unit tests work with browser side navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancel-navigations
Patch Set: Fixed nits Created 5 years, 11 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/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/metrics/user_metrics_action.h" 12 #include "base/metrics/user_metrics_action.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "content/browser/accessibility/accessibility_mode_helper.h" 14 #include "content/browser/accessibility/accessibility_mode_helper.h"
15 #include "content/browser/accessibility/browser_accessibility_manager.h" 15 #include "content/browser/accessibility/browser_accessibility_manager.h"
16 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 16 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
17 #include "content/browser/child_process_security_policy_impl.h" 17 #include "content/browser/child_process_security_policy_impl.h"
18 #include "content/browser/frame_host/cross_process_frame_connector.h" 18 #include "content/browser/frame_host/cross_process_frame_connector.h"
19 #include "content/browser/frame_host/cross_site_transferring_request.h" 19 #include "content/browser/frame_host/cross_site_transferring_request.h"
20 #include "content/browser/frame_host/frame_accessibility.h" 20 #include "content/browser/frame_host/frame_accessibility.h"
21 #include "content/browser/frame_host/frame_tree.h" 21 #include "content/browser/frame_host/frame_tree.h"
22 #include "content/browser/frame_host/frame_tree_node.h" 22 #include "content/browser/frame_host/frame_tree_node.h"
23 #include "content/browser/frame_host/navigator.h" 23 #include "content/browser/frame_host/navigator.h"
24 #include "content/browser/frame_host/navigator_impl.h"
24 #include "content/browser/frame_host/render_frame_host_delegate.h" 25 #include "content/browser/frame_host/render_frame_host_delegate.h"
25 #include "content/browser/frame_host/render_frame_proxy_host.h" 26 #include "content/browser/frame_host/render_frame_proxy_host.h"
26 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 27 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
27 #include "content/browser/geolocation/geolocation_service_context.h" 28 #include "content/browser/geolocation/geolocation_service_context.h"
28 #include "content/browser/permissions/permission_service_context.h" 29 #include "content/browser/permissions/permission_service_context.h"
29 #include "content/browser/permissions/permission_service_impl.h" 30 #include "content/browser/permissions/permission_service_impl.h"
30 #include "content/browser/renderer_host/input/input_router.h" 31 #include "content/browser/renderer_host/input/input_router.h"
31 #include "content/browser/renderer_host/input/timeout_monitor.h" 32 #include "content/browser/renderer_host/input/timeout_monitor.h"
32 #include "content/browser/renderer_host/render_process_host_impl.h" 33 #include "content/browser/renderer_host/render_process_host_impl.h"
33 #include "content/browser/renderer_host/render_view_host_delegate.h" 34 #include "content/browser/renderer_host/render_view_host_delegate.h"
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 877
877 frame_tree_node_->render_manager()->OnBeforeUnloadACK( 878 frame_tree_node_->render_manager()->OnBeforeUnloadACK(
878 unload_ack_is_for_cross_site_transition_, proceed, 879 unload_ack_is_for_cross_site_transition_, proceed,
879 before_unload_end_time); 880 before_unload_end_time);
880 881
881 // If canceled, notify the delegate to cancel its pending navigation entry. 882 // If canceled, notify the delegate to cancel its pending navigation entry.
882 if (!proceed) 883 if (!proceed)
883 render_view_host_->GetDelegate()->DidCancelLoading(); 884 render_view_host_->GetDelegate()->DidCancelLoading();
884 } 885 }
885 886
887 bool RenderFrameHostImpl::IsWaitingForBeforeUnloadACK() const {
888 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
889 switches::kEnableBrowserSideNavigation)) {
890 return is_waiting_for_beforeunload_ack_;
891 }
892 return frame_tree_node_->navigator()->IsWaitingForBeforeUnloadACK(
893 frame_tree_node_);
894 }
895
886 bool RenderFrameHostImpl::IsWaitingForUnloadACK() const { 896 bool RenderFrameHostImpl::IsWaitingForUnloadACK() const {
887 return render_view_host_->is_waiting_for_close_ack_ || 897 return render_view_host_->is_waiting_for_close_ack_ ||
888 rfh_state_ == STATE_PENDING_SWAP_OUT; 898 rfh_state_ == STATE_PENDING_SWAP_OUT;
889 } 899 }
890 900
891 void RenderFrameHostImpl::OnSwapOutACK() { 901 void RenderFrameHostImpl::OnSwapOutACK() {
892 OnSwappedOut(); 902 OnSwappedOut();
893 } 903 }
894 904
895 void RenderFrameHostImpl::OnSwappedOut() { 905 void RenderFrameHostImpl::OnSwappedOut() {
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1652 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1643 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1653 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1644 GetContentClient()->browser()->RegisterPermissionUsage( 1654 GetContentClient()->browser()->RegisterPermissionUsage(
1645 PERMISSION_GEOLOCATION, 1655 PERMISSION_GEOLOCATION,
1646 delegate_->GetAsWebContents(), 1656 delegate_->GetAsWebContents(),
1647 GetLastCommittedURL().GetOrigin(), 1657 GetLastCommittedURL().GetOrigin(),
1648 top_frame->GetLastCommittedURL().GetOrigin()); 1658 top_frame->GetLastCommittedURL().GetOrigin());
1649 } 1659 }
1650 1660
1651 } // namespace content 1661 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698