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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 // There's no need to reset the state: there's still an ongoing load, and the | 383 // There's no need to reset the state: there's still an ongoing load, and the |
384 // RenderFrameHostManager will take care of updates to the speculative | 384 // RenderFrameHostManager will take care of updates to the speculative |
385 // RenderFrameHost in DidCreateNavigationRequest below. | 385 // RenderFrameHost in DidCreateNavigationRequest below. |
386 if (was_previously_loading) | 386 if (was_previously_loading) |
387 ResetNavigationRequest(true); | 387 ResetNavigationRequest(true); |
388 | 388 |
389 navigation_request_ = std::move(navigation_request); | 389 navigation_request_ = std::move(navigation_request); |
390 render_manager()->DidCreateNavigationRequest(navigation_request_.get()); | 390 render_manager()->DidCreateNavigationRequest(navigation_request_.get()); |
391 | 391 |
392 // TODO(fdegans): Check if this is a same-document navigation and set the | 392 bool to_different_document = !FrameMsg_Navigate_Type::IsSameDocument( |
393 // proper argument. | 393 navigation_request_->common_params().navigation_type); |
394 DidStartLoading(true, was_previously_loading); | 394 |
| 395 DidStartLoading(to_different_document, was_previously_loading); |
395 } | 396 } |
396 | 397 |
397 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { | 398 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { |
398 CHECK(IsBrowserSideNavigationEnabled()); | 399 CHECK(IsBrowserSideNavigationEnabled()); |
399 if (!navigation_request_) | 400 if (!navigation_request_) |
400 return; | 401 return; |
401 bool was_renderer_initiated = !navigation_request_->browser_initiated(); | 402 bool was_renderer_initiated = !navigation_request_->browser_initiated(); |
402 NavigationRequest::AssociatedSiteInstanceType site_instance_type = | 403 NavigationRequest::AssociatedSiteInstanceType site_instance_type = |
403 navigation_request_->associated_site_instance_type(); | 404 navigation_request_->associated_site_instance_type(); |
404 navigation_request_.reset(); | 405 navigation_request_.reset(); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } | 553 } |
553 return parent_->child_at(i + relative_offset); | 554 return parent_->child_at(i + relative_offset); |
554 } | 555 } |
555 } | 556 } |
556 | 557 |
557 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 558 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
558 return nullptr; | 559 return nullptr; |
559 } | 560 } |
560 | 561 |
561 } // namespace content | 562 } // namespace content |
OLD | NEW |