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/frame_tree_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 357 |
358 // There's no need to reset the state: there's still an ongoing load, and the | 358 // There's no need to reset the state: there's still an ongoing load, and the |
359 // RenderFrameHostManager will take care of updates to the speculative | 359 // RenderFrameHostManager will take care of updates to the speculative |
360 // RenderFrameHost in DidCreateNavigationRequest below. | 360 // RenderFrameHost in DidCreateNavigationRequest below. |
361 if (was_previously_loading) | 361 if (was_previously_loading) |
362 ResetNavigationRequest(true); | 362 ResetNavigationRequest(true); |
363 | 363 |
364 navigation_request_ = std::move(navigation_request); | 364 navigation_request_ = std::move(navigation_request); |
365 render_manager()->DidCreateNavigationRequest(navigation_request_.get()); | 365 render_manager()->DidCreateNavigationRequest(navigation_request_.get()); |
366 | 366 |
367 // TODO(fdegans): Check if this is a same-document navigation and set the | 367 bool to_different_document = !FrameMsg_Navigate_Type::IsSameDocument( |
368 // proper argument. | 368 navigation_request_->common_params().navigation_type); |
369 DidStartLoading(true, was_previously_loading); | 369 |
| 370 DidStartLoading(to_different_document, was_previously_loading); |
370 } | 371 } |
371 | 372 |
372 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { | 373 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { |
373 CHECK(IsBrowserSideNavigationEnabled()); | 374 CHECK(IsBrowserSideNavigationEnabled()); |
374 if (!navigation_request_) | 375 if (!navigation_request_) |
375 return; | 376 return; |
376 bool was_renderer_initiated = !navigation_request_->browser_initiated(); | 377 bool was_renderer_initiated = !navigation_request_->browser_initiated(); |
377 NavigationRequest::AssociatedSiteInstanceType site_instance_type = | 378 NavigationRequest::AssociatedSiteInstanceType site_instance_type = |
378 navigation_request_->associated_site_instance_type(); | 379 navigation_request_->associated_site_instance_type(); |
379 navigation_request_.reset(); | 380 navigation_request_.reset(); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 528 } |
528 return parent_->child_at(i + relative_offset); | 529 return parent_->child_at(i + relative_offset); |
529 } | 530 } |
530 } | 531 } |
531 | 532 |
532 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 533 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
533 return nullptr; | 534 return nullptr; |
534 } | 535 } |
535 | 536 |
536 } // namespace content | 537 } // namespace content |
OLD | NEW |