| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 440 } |
| 441 | 441 |
| 442 // We only want to take the screenshot if the are navigating to a | 442 // We only want to take the screenshot if the are navigating to a |
| 443 // different history entry than the current one. So if neither the | 443 // different history entry than the current one. So if neither the |
| 444 // page id nor the url changed - don't take the screenshot. | 444 // page id nor the url changed - don't take the screenshot. |
| 445 if (page_id_changed || url_changed) | 445 if (page_id_changed || url_changed) |
| 446 controller_->TakeScreenshot(); | 446 controller_->TakeScreenshot(); |
| 447 } | 447 } |
| 448 | 448 |
| 449 // Run tasks that must execute just before the commit. | 449 // Run tasks that must execute just before the commit. |
| 450 delegate_->DidNavigateMainFramePreCommit(params); | 450 bool is_navigation_within_page = controller_->IsURLInPageNavigation( |
| 451 params.url, params.was_within_same_page, render_frame_host); |
| 452 delegate_->DidNavigateMainFramePreCommit(is_navigation_within_page); |
| 451 } | 453 } |
| 452 | 454 |
| 453 if (!use_site_per_process) | 455 if (!use_site_per_process) |
| 454 frame_tree->root()->render_manager()->DidNavigateFrame(render_frame_host); | 456 frame_tree->root()->render_manager()->DidNavigateFrame(render_frame_host); |
| 455 } | 457 } |
| 456 | 458 |
| 457 // When using --site-per-process, we notify the RFHM for all navigations, | 459 // When using --site-per-process, we notify the RFHM for all navigations, |
| 458 // not just main frame navigations. | 460 // not just main frame navigations. |
| 459 if (use_site_per_process) { | 461 if (use_site_per_process) { |
| 460 FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 462 FrameTreeNode* frame = render_frame_host->frame_tree_node(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 | 633 |
| 632 // Navigations in Web UI pages count as browser-initiated navigations. | 634 // Navigations in Web UI pages count as browser-initiated navigations. |
| 633 params.is_renderer_initiated = false; | 635 params.is_renderer_initiated = false; |
| 634 } | 636 } |
| 635 | 637 |
| 636 if (delegate_) | 638 if (delegate_) |
| 637 delegate_->RequestOpenURL(render_frame_host, params); | 639 delegate_->RequestOpenURL(render_frame_host, params); |
| 638 } | 640 } |
| 639 | 641 |
| 640 } // namespace content | 642 } // namespace content |
| OLD | NEW |