Chromium Code Reviews| 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1297 else | 1297 else |
| 1298 max_source_index++; | 1298 max_source_index++; |
| 1299 | 1299 |
| 1300 // Ignore the source's current entry if merging with replacement. | 1300 // Ignore the source's current entry if merging with replacement. |
| 1301 // TODO(davidben): This should preserve entries forward of the current | 1301 // TODO(davidben): This should preserve entries forward of the current |
| 1302 // too. http://crbug.com/317872 | 1302 // too. http://crbug.com/317872 |
| 1303 if (replace_entry && max_source_index > 0) | 1303 if (replace_entry && max_source_index > 0) |
| 1304 max_source_index--; | 1304 max_source_index--; |
| 1305 | 1305 |
| 1306 InsertEntriesFrom(*source, max_source_index); | 1306 InsertEntriesFrom(*source, max_source_index); |
| 1307 max_restored_page_id_ = source->max_restored_page_id_; | |
|
Charlie Reis
2014/04/24 18:02:02
nit: Let's put this down near the CopyMaxPageIDsFr
Alexander Semashko
2014/04/24 21:40:37
Done.
| |
| 1307 | 1308 |
| 1308 // Adjust indices such that the last entry and pending are at the end now. | 1309 // Adjust indices such that the last entry and pending are at the end now. |
| 1309 last_committed_entry_index_ = GetEntryCount() - 1; | 1310 last_committed_entry_index_ = GetEntryCount() - 1; |
| 1310 | 1311 |
| 1311 delegate_->SetHistoryLengthAndPrune(site_instance.get(), | 1312 delegate_->SetHistoryLengthAndPrune(site_instance.get(), |
| 1312 max_source_index, | 1313 max_source_index, |
| 1313 minimum_page_id); | 1314 minimum_page_id); |
| 1314 | 1315 |
| 1315 // Copy the max page id map from the old tab to the new tab. This ensures | 1316 // Copy the max page id map from the old tab to the new tab. This ensures |
| 1316 // that new and existing navigations in the tab's current SiteInstances | 1317 // that new and existing navigations in the tab's current SiteInstances |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1743 } | 1744 } |
| 1744 } | 1745 } |
| 1745 } | 1746 } |
| 1746 | 1747 |
| 1747 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1748 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 1748 const base::Callback<base::Time()>& get_timestamp_callback) { | 1749 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 1749 get_timestamp_callback_ = get_timestamp_callback; | 1750 get_timestamp_callback_ = get_timestamp_callback; |
| 1750 } | 1751 } |
| 1751 | 1752 |
| 1752 } // namespace content | 1753 } // namespace content |
| OLD | NEW |