| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/tab_contents/navigation_controller.h" | 5 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 params.page_id); | 788 params.page_id); |
| 789 | 789 |
| 790 // Reference fragment navigation. We're guaranteed to have the last_committed | 790 // Reference fragment navigation. We're guaranteed to have the last_committed |
| 791 // entry and it will be the same page as the new navigation (minus the | 791 // entry and it will be the same page as the new navigation (minus the |
| 792 // reference fragments, of course). | 792 // reference fragments, of course). |
| 793 NavigationEntry* new_entry = new NavigationEntry(*existing_entry); | 793 NavigationEntry* new_entry = new NavigationEntry(*existing_entry); |
| 794 new_entry->set_page_id(params.page_id); | 794 new_entry->set_page_id(params.page_id); |
| 795 if (new_entry->update_virtual_url_with_url()) | 795 if (new_entry->update_virtual_url_with_url()) |
| 796 UpdateVirtualURLToURL(new_entry, params.url); | 796 UpdateVirtualURLToURL(new_entry, params.url); |
| 797 new_entry->set_url(params.url); | 797 new_entry->set_url(params.url); |
| 798 *did_replace_entry = IsRedirect(params) && | 798 |
| 799 IsLikelyAutoNavigation(base::TimeTicks::Now()); | 799 // This replaces the existing entry since the page ID didn't change. |
| 800 InsertOrReplaceEntry(new_entry, *did_replace_entry); | 800 *did_replace_entry = true; |
| 801 InsertOrReplaceEntry(new_entry, true); |
| 801 } | 802 } |
| 802 | 803 |
| 803 void NavigationController::RendererDidNavigateNewSubframe( | 804 void NavigationController::RendererDidNavigateNewSubframe( |
| 804 const ViewHostMsg_FrameNavigate_Params& params) { | 805 const ViewHostMsg_FrameNavigate_Params& params) { |
| 805 if (PageTransition::StripQualifier(params.transition) == | 806 if (PageTransition::StripQualifier(params.transition) == |
| 806 PageTransition::AUTO_SUBFRAME) { | 807 PageTransition::AUTO_SUBFRAME) { |
| 807 // This is not user-initiated. Ignore. | 808 // This is not user-initiated. Ignore. |
| 808 return; | 809 return; |
| 809 } | 810 } |
| 810 | 811 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 return i; | 1097 return i; |
| 1097 } | 1098 } |
| 1098 return -1; | 1099 return -1; |
| 1099 } | 1100 } |
| 1100 | 1101 |
| 1101 NavigationEntry* NavigationController::GetTransientEntry() const { | 1102 NavigationEntry* NavigationController::GetTransientEntry() const { |
| 1102 if (transient_entry_index_ == -1) | 1103 if (transient_entry_index_ == -1) |
| 1103 return NULL; | 1104 return NULL; |
| 1104 return entries_[transient_entry_index_].get(); | 1105 return entries_[transient_entry_index_].get(); |
| 1105 } | 1106 } |
| OLD | NEW |