| 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
| 9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
| 10 #include "content/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 controller_->GetPendingEntry()); | 389 controller_->GetPendingEntry()); |
| 390 if (!render_frame_host->frame_tree_node()->IsMainFrame() && | 390 if (!render_frame_host->frame_tree_node()->IsMainFrame() && |
| 391 pending_entry && | 391 pending_entry && |
| 392 pending_entry->frame_tree_node_id() == | 392 pending_entry->frame_tree_node_id() == |
| 393 render_frame_host->frame_tree_node()->frame_tree_node_id()) { | 393 render_frame_host->frame_tree_node()->frame_tree_node_id()) { |
| 394 params.transition = PAGE_TRANSITION_AUTO_SUBFRAME; | 394 params.transition = PAGE_TRANSITION_AUTO_SUBFRAME; |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 | 397 |
| 398 if (PageTransitionIsMainFrame(params.transition)) { | 398 if (PageTransitionIsMainFrame(params.transition)) { |
| 399 // When overscroll navigation gesture is enabled, a screenshot of the page | 399 if (delegate_) { |
| 400 // in its current state is taken so that it can be used during the | 400 // When overscroll navigation gesture is enabled, a screenshot of the page |
| 401 // nav-gesture. It is necessary to take the screenshot here, before calling | 401 // in its current state is taken so that it can be used during the |
| 402 // RenderFrameHostManager::DidNavigateMainFrame, because that can change | 402 // nav-gesture. It is necessary to take the screenshot here, before |
| 403 // WebContents::GetRenderViewHost to return the new host, instead of the one | 403 // calling RenderFrameHostManager::DidNavigateMainFrame, because that can |
| 404 // that may have just been swapped out. | 404 // change WebContents::GetRenderViewHost to return the new host, instead |
| 405 if (delegate_ && delegate_->CanOverscrollContent()) | 405 // of the one that may have just been swapped out. |
| 406 controller_->TakeScreenshot(); | 406 if (delegate_->CanOverscrollContent()) |
| 407 controller_->TakeScreenshot(); |
| 408 |
| 409 // Run tasks that must execute just before the commit. |
| 410 delegate_->DidNavigateMainFramePreCommit(params); |
| 411 } |
| 407 | 412 |
| 408 if (!use_site_per_process) | 413 if (!use_site_per_process) |
| 409 frame_tree->root()->render_manager()->DidNavigateFrame(render_frame_host); | 414 frame_tree->root()->render_manager()->DidNavigateFrame(render_frame_host); |
| 410 } | 415 } |
| 411 | 416 |
| 412 // When using --site-per-process, we notify the RFHM for all navigations, | 417 // When using --site-per-process, we notify the RFHM for all navigations, |
| 413 // not just main frame navigations. | 418 // not just main frame navigations. |
| 414 if (use_site_per_process) { | 419 if (use_site_per_process) { |
| 415 FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 420 FrameTreeNode* frame = render_frame_host->frame_tree_node(); |
| 416 frame->render_manager()->DidNavigateFrame(render_frame_host); | 421 frame->render_manager()->DidNavigateFrame(render_frame_host); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 | 591 |
| 587 // Navigations in Web UI pages count as browser-initiated navigations. | 592 // Navigations in Web UI pages count as browser-initiated navigations. |
| 588 params.is_renderer_initiated = false; | 593 params.is_renderer_initiated = false; |
| 589 } | 594 } |
| 590 | 595 |
| 591 if (delegate_) | 596 if (delegate_) |
| 592 delegate_->RequestOpenURL(render_frame_host, params); | 597 delegate_->RequestOpenURL(render_frame_host, params); |
| 593 } | 598 } |
| 594 | 599 |
| 595 } // namespace content | 600 } // namespace content |
| OLD | NEW |