| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 637 |
| 638 if (navigation_handle->GetFrameTreeNodeId() != frame_tree_node_id_) | 638 if (navigation_handle->GetFrameTreeNodeId() != frame_tree_node_id_) |
| 639 return; | 639 return; |
| 640 | 640 |
| 641 --navigations_remaining_; | 641 --navigations_remaining_; |
| 642 transitions_.push_back(navigation_handle->GetPageTransition()); | 642 transitions_.push_back(navigation_handle->GetPageTransition()); |
| 643 urls_.push_back(navigation_handle->GetURL()); | 643 urls_.push_back(navigation_handle->GetURL()); |
| 644 navigation_types_.push_back( | 644 navigation_types_.push_back( |
| 645 static_cast<NavigationHandleImpl*>(navigation_handle) | 645 static_cast<NavigationHandleImpl*>(navigation_handle) |
| 646 ->navigation_type()); | 646 ->navigation_type()); |
| 647 is_in_pages_.push_back(navigation_handle->IsSamePage()); | 647 is_in_pages_.push_back(navigation_handle->IsSameDocument()); |
| 648 if (!navigations_remaining_ && | 648 if (!navigations_remaining_ && |
| 649 (!web_contents()->IsLoading() || !wait_for_load_)) | 649 (!web_contents()->IsLoading() || !wait_for_load_)) |
| 650 message_loop_runner_->Quit(); | 650 message_loop_runner_->Quit(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 void DidStopLoading() override { | 653 void DidStopLoading() override { |
| 654 if (!navigations_remaining_) | 654 if (!navigations_remaining_) |
| 655 message_loop_runner_->Quit(); | 655 message_loop_runner_->Quit(); |
| 656 } | 656 } |
| 657 | 657 |
| (...skipping 6001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6659 | 6659 |
| 6660 bool has_committed() const { return has_committed_; } | 6660 bool has_committed() const { return has_committed_; } |
| 6661 bool was_same_page() const { return was_same_page_; } | 6661 bool was_same_page() const { return was_same_page_; } |
| 6662 bool was_renderer_initiated() const { return was_renderer_initiated_; } | 6662 bool was_renderer_initiated() const { return was_renderer_initiated_; } |
| 6663 | 6663 |
| 6664 private: | 6664 private: |
| 6665 void DidFinishNavigation(NavigationHandle* handle) override { | 6665 void DidFinishNavigation(NavigationHandle* handle) override { |
| 6666 if (handle->GetURL() != url_) | 6666 if (handle->GetURL() != url_) |
| 6667 return; | 6667 return; |
| 6668 has_committed_ = true; | 6668 has_committed_ = true; |
| 6669 was_same_page_ = handle->IsSamePage(); | 6669 was_same_page_ = handle->IsSameDocument(); |
| 6670 was_renderer_initiated_ = handle->IsRendererInitiated(); | 6670 was_renderer_initiated_ = handle->IsRendererInitiated(); |
| 6671 } | 6671 } |
| 6672 | 6672 |
| 6673 const GURL url_; | 6673 const GURL url_; |
| 6674 bool has_committed_; | 6674 bool has_committed_; |
| 6675 bool was_same_page_; | 6675 bool was_same_page_; |
| 6676 bool was_renderer_initiated_; | 6676 bool was_renderer_initiated_; |
| 6677 }; | 6677 }; |
| 6678 | 6678 |
| 6679 // Test that a same-page navigation does not lead to the deletion of the | 6679 // Test that a same-page navigation does not lead to the deletion of the |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6790 | 6790 |
| 6791 // Do a 204 navigation. | 6791 // Do a 204 navigation. |
| 6792 EXPECT_FALSE(NavigateToURL(shell(), kURL204)); | 6792 EXPECT_FALSE(NavigateToURL(shell(), kURL204)); |
| 6793 | 6793 |
| 6794 entry = controller.GetLastCommittedEntry(); | 6794 entry = controller.GetLastCommittedEntry(); |
| 6795 EXPECT_EQ(kURL, entry->GetURL()); | 6795 EXPECT_EQ(kURL, entry->GetURL()); |
| 6796 EXPECT_EQ(1, controller.GetEntryCount()); | 6796 EXPECT_EQ(1, controller.GetEntryCount()); |
| 6797 } | 6797 } |
| 6798 | 6798 |
| 6799 } // namespace content | 6799 } // namespace content |
| OLD | NEW |