Index: content/browser/tab_contents/navigation_controller.cc |
diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc |
index 315a47110bb8661c0e91c1ceb31b4f643c9b59c0..85780cdbe06e065fbca7ec16c313d124502f4ea1 100644 |
--- a/content/browser/tab_contents/navigation_controller.cc |
+++ b/content/browser/tab_contents/navigation_controller.cc |
@@ -285,6 +285,15 @@ NavigationEntry* NavigationController::GetActiveEntry() const { |
return GetLastCommittedEntry(); |
} |
+NavigationEntry* NavigationController::GetVisibleEntry() const { |
+ if (transient_entry_index_ != -1) |
+ return entries_[transient_entry_index_].get(); |
+ // Only return pending_entry for new navigations. |
+ if (pending_entry_ && pending_entry_->page_id() == -1) |
+ return pending_entry_; |
+ return GetLastCommittedEntry(); |
+} |
+ |
int NavigationController::GetCurrentEntryIndex() const { |
if (transient_entry_index_ != -1) |
return transient_entry_index_; |