| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index ab77559add0cbaab6344d28e9c8a403e1f1938c6..36e199d2fefc6ca1a9bdd23f723e93296e4ef1ad 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -908,7 +908,7 @@ void WebContentsImpl::SetUserAgentOverride(const std::string& override) {
|
|
|
| // Reload the page if a load is currently in progress to avoid having
|
| // different parts of the page loaded using different user agents.
|
| - NavigationEntry* entry = controller_.GetActiveEntry();
|
| + NavigationEntry* entry = controller_.GetVisibleEntry();
|
| if (is_loading_ && entry != NULL && entry->GetIsOverridingUserAgent())
|
| controller_.ReloadIgnoringCache(true);
|
|
|
| @@ -1963,7 +1963,7 @@ void WebContentsImpl::SaveFrame(const GURL& url,
|
| return;
|
| int64 post_id = -1;
|
| if (is_main_frame) {
|
| - const NavigationEntry* entry = controller_.GetActiveEntry();
|
| + const NavigationEntry* entry = controller_.GetLastCommittedEntry();
|
| if (entry)
|
| post_id = entry->GetPostID();
|
| }
|
| @@ -1984,12 +1984,13 @@ void WebContentsImpl::GenerateMHTML(
|
| MHTMLGenerationManager::GetInstance()->SaveMHTML(this, file, callback);
|
| }
|
|
|
| +// TODO(nasko): Rename this method to IsVisibleEntry.
|
| bool WebContentsImpl::IsActiveEntry(int32 page_id) {
|
| - NavigationEntryImpl* active_entry =
|
| - NavigationEntryImpl::FromNavigationEntry(controller_.GetActiveEntry());
|
| - return (active_entry != NULL &&
|
| - active_entry->site_instance() == GetSiteInstance() &&
|
| - active_entry->GetPageID() == page_id);
|
| + NavigationEntryImpl* visible_entry =
|
| + NavigationEntryImpl::FromNavigationEntry(controller_.GetVisibleEntry());
|
| + return (visible_entry != NULL &&
|
| + visible_entry->site_instance() == GetSiteInstance() &&
|
| + visible_entry->GetPageID() == page_id);
|
| }
|
|
|
| const std::string& WebContentsImpl::GetContentsMimeType() const {
|
| @@ -2071,10 +2072,10 @@ double WebContentsImpl::GetZoomLevel() const {
|
| GetRenderProcessHost()->GetID(), GetRenderViewHost()->GetRoutingID());
|
| } else {
|
| GURL url;
|
| - NavigationEntry* active_entry = GetController().GetActiveEntry();
|
| + NavigationEntry* entry = GetController().GetLastCommittedEntry();
|
| // Since zoom map is updated using rewritten URL, use rewritten URL
|
| // to get the zoom level.
|
| - url = active_entry ? active_entry->GetURL() : GURL::EmptyGURL();
|
| + url = entry ? entry->GetURL() : GURL::EmptyGURL();
|
| zoom_level = zoom_map->GetZoomLevelForHostAndScheme(url.scheme(),
|
| net::GetHostOrSpecFromURL(url));
|
| }
|
| @@ -2097,11 +2098,11 @@ void WebContentsImpl::ViewSource() {
|
| if (!delegate_)
|
| return;
|
|
|
| - NavigationEntry* active_entry = GetController().GetActiveEntry();
|
| - if (!active_entry)
|
| + NavigationEntry* entry = GetController().GetLastCommittedEntry();
|
| + if (!entry)
|
| return;
|
|
|
| - delegate_->ViewSourceForTab(this, active_entry->GetURL());
|
| + delegate_->ViewSourceForTab(this, entry->GetURL());
|
| }
|
|
|
| void WebContentsImpl::ViewFrameSource(const GURL& url,
|
| @@ -2156,7 +2157,7 @@ int WebContentsImpl::DownloadImage(const GURL& url,
|
| }
|
|
|
| bool WebContentsImpl::FocusLocationBarByDefault() {
|
| - NavigationEntry* entry = controller_.GetActiveEntry();
|
| + NavigationEntry* entry = controller_.GetVisibleEntry();
|
| if (entry && entry->GetURL() == GURL(kAboutBlankURL))
|
| return true;
|
| return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this);
|
| @@ -2916,7 +2917,7 @@ void WebContentsImpl::RenderViewCreated(RenderViewHost* render_view_host) {
|
| if (render_manager_.pending_web_ui())
|
| render_manager_.pending_web_ui()->RenderViewCreated(render_view_host);
|
|
|
| - NavigationEntry* entry = controller_.GetActiveEntry();
|
| + NavigationEntry* entry = controller_.GetPendingEntry();
|
| if (entry && entry->IsViewSourceMode()) {
|
| // Put the renderer in view source mode.
|
| render_view_host->Send(
|
| @@ -3073,7 +3074,7 @@ void WebContentsImpl::DidNavigate(
|
| // forward in the history is only stored in the navigation controller's
|
| // entry list.
|
| if (did_navigate &&
|
| - (controller_.GetActiveEntry()->GetTransitionType() &
|
| + (controller_.GetLastCommittedEntry()->GetTransitionType() &
|
| PAGE_TRANSITION_FORWARD_BACK)) {
|
| transition_type = PageTransitionFromInt(
|
| params.transition | PAGE_TRANSITION_FORWARD_BACK);
|
|
|