| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // NOTE(darin): This code is only needed for backwards compat. | 102 // NOTE(darin): This code is only needed for backwards compat. |
| 103 SetPageStateIfEmpty((*entries)[i].get()); | 103 SetPageStateIfEmpty((*entries)[i].get()); |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 // See NavigationController::IsURLInPageNavigation for how this works and why. | 107 // See NavigationController::IsURLInPageNavigation for how this works and why. |
| 108 bool AreURLsInPageNavigation(const GURL& existing_url, | 108 bool AreURLsInPageNavigation(const GURL& existing_url, |
| 109 const GURL& new_url, | 109 const GURL& new_url, |
| 110 bool renderer_says_in_page, | 110 bool renderer_says_in_page, |
| 111 NavigationType navigation_type) { | 111 NavigationType navigation_type) { |
| 112 if (existing_url == new_url) | 112 if (existing_url.GetOrigin() == new_url.GetOrigin()) |
| 113 return renderer_says_in_page; | 113 return renderer_says_in_page; |
| 114 | 114 |
| 115 if (!new_url.has_ref()) { | 115 if (!new_url.has_ref()) { |
| 116 // When going back from the ref URL to the non ref one the navigation type | 116 // When going back from the ref URL to the non ref one the navigation type |
| 117 // is IN_PAGE. | 117 // is IN_PAGE. |
| 118 return navigation_type == NAVIGATION_TYPE_IN_PAGE; | 118 return navigation_type == NAVIGATION_TYPE_IN_PAGE; |
| 119 } | 119 } |
| 120 | 120 |
| 121 url::Replacements<char> replacements; | 121 url::Replacements<char> replacements; |
| 122 replacements.ClearRef(); | 122 replacements.ClearRef(); |
| (...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 } | 1761 } |
| 1762 } | 1762 } |
| 1763 } | 1763 } |
| 1764 | 1764 |
| 1765 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1765 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 1766 const base::Callback<base::Time()>& get_timestamp_callback) { | 1766 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 1767 get_timestamp_callback_ = get_timestamp_callback; | 1767 get_timestamp_callback_ = get_timestamp_callback; |
| 1768 } | 1768 } |
| 1769 | 1769 |
| 1770 } // namespace content | 1770 } // namespace content |
| OLD | NEW |