| 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 "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
| 10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 if (delegate_) | 366 if (delegate_) |
| 367 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host); | 367 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host); |
| 368 | 368 |
| 369 // WebContents uses this to fill LoadNotificationDetails when the load | 369 // WebContents uses this to fill LoadNotificationDetails when the load |
| 370 // completes, so that PerformanceMonitor that listens to the notification can | 370 // completes, so that PerformanceMonitor that listens to the notification can |
| 371 // record the load time. PerformanceMonitor is no longer maintained. | 371 // record the load time. PerformanceMonitor is no longer maintained. |
| 372 // TODO(ppi): make this go away. | 372 // TODO(ppi): make this go away. |
| 373 current_load_start_ = base::TimeTicks::Now(); | 373 current_load_start_ = base::TimeTicks::Now(); |
| 374 | 374 |
| 375 // Navigate in the desired RenderFrameHost. | 375 // Navigate in the desired RenderFrameHost. |
| 376 // We can skip this step in the rare case that this is a transfer navigation |
| 377 // which began in the chosen RenderFrameHost, since the request has already |
| 378 // been issued. In that case, simply resume the response. |
| 376 FrameMsg_Navigate_Params navigate_params; | 379 FrameMsg_Navigate_Params navigate_params; |
| 377 MakeNavigateParams(entry, *controller_, reload_type, navigation_start, | 380 MakeNavigateParams(entry, *controller_, reload_type, navigation_start, |
| 378 &navigate_params); | 381 &navigate_params); |
| 379 dest_render_frame_host->Navigate(navigate_params); | 382 bool is_transfer_to_same = |
| 383 navigate_params.transferred_request_child_id != -1 && |
| 384 navigate_params.transferred_request_child_id == |
| 385 dest_render_frame_host->GetProcess()->GetID(); |
| 386 if (!is_transfer_to_same) { |
| 387 dest_render_frame_host->Navigate(navigate_params); |
| 388 } else { |
| 389 // No need to navigate again. Just resume the deferred request. |
| 390 dest_render_frame_host->GetProcess()->ResumeDeferredNavigation( |
| 391 GlobalRequestID(navigate_params.transferred_request_child_id, |
| 392 navigate_params.transferred_request_request_id)); |
| 393 } |
| 380 | 394 |
| 381 // Make sure no code called via RFH::Navigate clears the pending entry. | 395 // Make sure no code called via RFH::Navigate clears the pending entry. |
| 382 CHECK_EQ(controller_->GetPendingEntry(), &entry); | 396 CHECK_EQ(controller_->GetPendingEntry(), &entry); |
| 383 | 397 |
| 384 if (entry.GetPageID() == -1) { | 398 if (entry.GetPageID() == -1) { |
| 385 // HACK!! This code suppresses javascript: URLs from being added to | 399 // HACK!! This code suppresses javascript: URLs from being added to |
| 386 // session history, which is what we want to do for javascript: URLs that | 400 // session history, which is what we want to do for javascript: URLs that |
| 387 // do not generate content. What we really need is a message from the | 401 // do not generate content. What we really need is a message from the |
| 388 // renderer telling us that a new page was not created. The same message | 402 // renderer telling us that a new page was not created. The same message |
| 389 // could be used for mailto: URLs and the like. | 403 // could be used for mailto: URLs and the like. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 651 |
| 638 // Navigations in Web UI pages count as browser-initiated navigations. | 652 // Navigations in Web UI pages count as browser-initiated navigations. |
| 639 params.is_renderer_initiated = false; | 653 params.is_renderer_initiated = false; |
| 640 } | 654 } |
| 641 | 655 |
| 642 if (delegate_) | 656 if (delegate_) |
| 643 delegate_->RequestOpenURL(render_frame_host, params); | 657 delegate_->RequestOpenURL(render_frame_host, params); |
| 644 } | 658 } |
| 645 | 659 |
| 646 } // namespace content | 660 } // namespace content |
| OLD | NEW |