| OLD | NEW |
| 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_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 } | 461 } |
| 462 | 462 |
| 463 if (render_frame_host == pending_render_frame_host_.get() || | 463 if (render_frame_host == pending_render_frame_host_.get() || |
| 464 render_frame_host == speculative_render_frame_host_.get()) { | 464 render_frame_host == speculative_render_frame_host_.get()) { |
| 465 // A cross-process navigation completed, so show the new renderer. If a | 465 // A cross-process navigation completed, so show the new renderer. If a |
| 466 // same-process navigation is also ongoing, it will be canceled when the | 466 // same-process navigation is also ongoing, it will be canceled when the |
| 467 // pending/speculative RenderFrameHost replaces the current one in the | 467 // pending/speculative RenderFrameHost replaces the current one in the |
| 468 // commit call below. | 468 // commit call below. |
| 469 CommitPending(); | 469 CommitPending(); |
| 470 if (IsBrowserSideNavigationEnabled()) | 470 if (IsBrowserSideNavigationEnabled()) |
| 471 frame_tree_node_->ResetNavigationRequest(false); | 471 frame_tree_node_->ResetNavigationRequest(false, true); |
| 472 } else if (render_frame_host == render_frame_host_.get()) { | 472 } else if (render_frame_host == render_frame_host_.get()) { |
| 473 // A same-process navigation committed while a simultaneous cross-process | 473 // A same-process navigation committed while a simultaneous cross-process |
| 474 // navigation is still ongoing. | 474 // navigation is still ongoing. |
| 475 | 475 |
| 476 // If the current RenderFrameHost has a pending WebUI it must be committed. | 476 // If the current RenderFrameHost has a pending WebUI it must be committed. |
| 477 if (render_frame_host_->pending_web_ui()) | 477 if (render_frame_host_->pending_web_ui()) |
| 478 CommitPendingWebUI(); | 478 CommitPendingWebUI(); |
| 479 | 479 |
| 480 // A navigation in the original page has taken place. Cancel the pending | 480 // A navigation in the original page has taken place. Cancel the pending |
| 481 // one. Only do it for user gesture originated navigations to prevent page | 481 // one. Only do it for user gesture originated navigations to prevent page |
| 482 // doing any shenanigans to prevent user from navigating. See | 482 // doing any shenanigans to prevent user from navigating. See |
| 483 // https://code.google.com/p/chromium/issues/detail?id=75195 | 483 // https://code.google.com/p/chromium/issues/detail?id=75195 |
| 484 if (was_caused_by_user_gesture) { | 484 if (was_caused_by_user_gesture) { |
| 485 if (IsBrowserSideNavigationEnabled()) { | 485 if (IsBrowserSideNavigationEnabled()) { |
| 486 CleanUpNavigation(); | 486 CleanUpNavigation(); |
| 487 frame_tree_node_->ResetNavigationRequest(false); | 487 frame_tree_node_->ResetNavigationRequest(false, true); |
| 488 } else { | 488 } else { |
| 489 CancelPending(); | 489 CancelPending(); |
| 490 } | 490 } |
| 491 } | 491 } |
| 492 } else { | 492 } else { |
| 493 // No one else should be sending us DidNavigate in this state. | 493 // No one else should be sending us DidNavigate in this state. |
| 494 NOTREACHED(); | 494 NOTREACHED(); |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 | 497 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 GetRenderFrameProxyHost(instance)->set_render_frame_proxy_created(false); | 996 GetRenderFrameProxyHost(instance)->set_render_frame_proxy_created(false); |
| 997 } | 997 } |
| 998 | 998 |
| 999 void RenderFrameHostManager::CancelPendingIfNecessary( | 999 void RenderFrameHostManager::CancelPendingIfNecessary( |
| 1000 RenderFrameHostImpl* render_frame_host) { | 1000 RenderFrameHostImpl* render_frame_host) { |
| 1001 if (render_frame_host == pending_render_frame_host_.get()) | 1001 if (render_frame_host == pending_render_frame_host_.get()) |
| 1002 CancelPending(); | 1002 CancelPending(); |
| 1003 else if (render_frame_host == speculative_render_frame_host_.get()) { | 1003 else if (render_frame_host == speculative_render_frame_host_.get()) { |
| 1004 // TODO(nasko, clamy): This should just clean up the speculative RFH | 1004 // TODO(nasko, clamy): This should just clean up the speculative RFH |
| 1005 // without canceling the request. See https://crbug.com/636119. | 1005 // without canceling the request. See https://crbug.com/636119. |
| 1006 frame_tree_node_->ResetNavigationRequest(false); | 1006 frame_tree_node_->ResetNavigationRequest(false, true); |
| 1007 } | 1007 } |
| 1008 } | 1008 } |
| 1009 | 1009 |
| 1010 void RenderFrameHostManager::OnSetHasReceivedUserGesture() { | 1010 void RenderFrameHostManager::OnSetHasReceivedUserGesture() { |
| 1011 for (const auto& pair : proxy_hosts_) { | 1011 for (const auto& pair : proxy_hosts_) { |
| 1012 pair.second->Send( | 1012 pair.second->Send( |
| 1013 new FrameMsg_SetHasReceivedUserGesture(pair.second->GetRoutingID())); | 1013 new FrameMsg_SetHasReceivedUserGesture(pair.second->GetRoutingID())); |
| 1014 } | 1014 } |
| 1015 } | 1015 } |
| 1016 | 1016 |
| (...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2802 delegate_->IsHidden()) { | 2802 delegate_->IsHidden()) { |
| 2803 if (delegate_->IsHidden()) { | 2803 if (delegate_->IsHidden()) { |
| 2804 render_frame_host_->GetView()->Hide(); | 2804 render_frame_host_->GetView()->Hide(); |
| 2805 } else { | 2805 } else { |
| 2806 render_frame_host_->GetView()->Show(); | 2806 render_frame_host_->GetView()->Show(); |
| 2807 } | 2807 } |
| 2808 } | 2808 } |
| 2809 } | 2809 } |
| 2810 | 2810 |
| 2811 } // namespace content | 2811 } // namespace content |
| OLD | NEW |