| 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/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" // Temporary | 10 #include "base/strings/string_number_conversions.h" // Temporary |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 params.was_within_same_page, | 959 params.was_within_same_page, |
| 960 NAVIGATION_TYPE_UNKNOWN)) { | 960 NAVIGATION_TYPE_UNKNOWN)) { |
| 961 return NAVIGATION_TYPE_IN_PAGE; | 961 return NAVIGATION_TYPE_IN_PAGE; |
| 962 } | 962 } |
| 963 | 963 |
| 964 // Since we weeded out "new" navigations above, we know this is an existing | 964 // Since we weeded out "new" navigations above, we know this is an existing |
| 965 // (back/forward) navigation. | 965 // (back/forward) navigation. |
| 966 return NAVIGATION_TYPE_EXISTING_PAGE; | 966 return NAVIGATION_TYPE_EXISTING_PAGE; |
| 967 } | 967 } |
| 968 | 968 |
| 969 bool NavigationControllerImpl::IsRedirect( | |
| 970 const ViewHostMsg_FrameNavigate_Params& params) { | |
| 971 // For main frame transition, we judge by params.transition. | |
| 972 // Otherwise, by params.redirects. | |
| 973 if (PageTransitionIsMainFrame(params.transition)) { | |
| 974 return PageTransitionIsRedirect(params.transition); | |
| 975 } | |
| 976 return params.redirects.size() > 1; | |
| 977 } | |
| 978 | |
| 979 void NavigationControllerImpl::RendererDidNavigateToNewPage( | 969 void NavigationControllerImpl::RendererDidNavigateToNewPage( |
| 980 const ViewHostMsg_FrameNavigate_Params& params, bool replace_entry) { | 970 const ViewHostMsg_FrameNavigate_Params& params, bool replace_entry) { |
| 981 NavigationEntryImpl* new_entry; | 971 NavigationEntryImpl* new_entry; |
| 982 bool update_virtual_url; | 972 bool update_virtual_url; |
| 983 // Only make a copy of the pending entry if it is appropriate for the new page | 973 // Only make a copy of the pending entry if it is appropriate for the new page |
| 984 // that was just loaded. We verify this at a coarse grain by checking that | 974 // that was just loaded. We verify this at a coarse grain by checking that |
| 985 // the SiteInstance hasn't been assigned to something else. | 975 // the SiteInstance hasn't been assigned to something else. |
| 986 if (pending_entry_ && | 976 if (pending_entry_ && |
| 987 (!pending_entry_->site_instance() || | 977 (!pending_entry_->site_instance() || |
| 988 pending_entry_->site_instance() == delegate_->GetSiteInstance())) { | 978 pending_entry_->site_instance() == delegate_->GetSiteInstance())) { |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 } | 1681 } |
| 1692 } | 1682 } |
| 1693 } | 1683 } |
| 1694 | 1684 |
| 1695 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1685 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 1696 const base::Callback<base::Time()>& get_timestamp_callback) { | 1686 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 1697 get_timestamp_callback_ = get_timestamp_callback; | 1687 get_timestamp_callback_ = get_timestamp_callback; |
| 1698 } | 1688 } |
| 1699 | 1689 |
| 1700 } // namespace content | 1690 } // namespace content |
| OLD | NEW |