| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/navigation_controller_impl.h" | 5 #include "content/browser/web_contents/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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 NavigateToPendingEntry(NO_RELOAD); | 593 NavigateToPendingEntry(NO_RELOAD); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void NavigationControllerImpl::GoToOffset(int offset) { | 596 void NavigationControllerImpl::GoToOffset(int offset) { |
| 597 if (!CanGoToOffset(offset)) | 597 if (!CanGoToOffset(offset)) |
| 598 return; | 598 return; |
| 599 | 599 |
| 600 GoToIndex(GetIndexForOffset(offset)); | 600 GoToIndex(GetIndexForOffset(offset)); |
| 601 } | 601 } |
| 602 | 602 |
| 603 void NavigationControllerImpl::RemoveEntryAtIndex(int index) { | 603 bool NavigationControllerImpl::RemoveEntryAtIndex(int index) { |
| 604 if (index == last_committed_entry_index_) | 604 if (index == last_committed_entry_index_ || |
| 605 return; | 605 index == pending_entry_index_) |
| 606 return false; |
| 606 | 607 |
| 607 RemoveEntryAtIndexInternal(index); | 608 RemoveEntryAtIndexInternal(index); |
| 609 return true; |
| 608 } | 610 } |
| 609 | 611 |
| 610 void NavigationControllerImpl::UpdateVirtualURLToURL( | 612 void NavigationControllerImpl::UpdateVirtualURLToURL( |
| 611 NavigationEntryImpl* entry, const GURL& new_url) { | 613 NavigationEntryImpl* entry, const GURL& new_url) { |
| 612 GURL new_virtual_url(new_url); | 614 GURL new_virtual_url(new_url); |
| 613 if (BrowserURLHandlerImpl::GetInstance()->ReverseURLRewrite( | 615 if (BrowserURLHandlerImpl::GetInstance()->ReverseURLRewrite( |
| 614 &new_virtual_url, entry->GetVirtualURL(), browser_context_)) { | 616 &new_virtual_url, entry->GetVirtualURL(), browser_context_)) { |
| 615 entry->SetVirtualURL(new_virtual_url); | 617 entry->SetVirtualURL(new_virtual_url); |
| 616 } | 618 } |
| 617 } | 619 } |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 } | 1684 } |
| 1683 } | 1685 } |
| 1684 } | 1686 } |
| 1685 | 1687 |
| 1686 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1688 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 1687 const base::Callback<base::Time()>& get_timestamp_callback) { | 1689 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 1688 get_timestamp_callback_ = get_timestamp_callback; | 1690 get_timestamp_callback_ = get_timestamp_callback; |
| 1689 } | 1691 } |
| 1690 | 1692 |
| 1691 } // namespace content | 1693 } // namespace content |
| OLD | NEW |