Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index 366c7030e004a8327b3e05ce97282154e43215e1..8fa21dc458b1cac2fe80adfc54126e31a35d352e 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -2555,7 +2555,7 @@ |
// new navigation. |
navigation_state->set_request_committed(true); |
- SendDidCommitProvisionalLoad(frame, commit_type); |
+ SendDidCommitProvisionalLoad(frame); |
// Check whether we have new encoding name. |
UpdateEncoding(frame, frame->view()->pageEncoding().utf8()); |
@@ -3619,9 +3619,7 @@ |
} |
// Tell the embedding application that the URL of the active page has changed. |
-void RenderFrameImpl::SendDidCommitProvisionalLoad( |
- blink::WebFrame* frame, |
- blink::WebHistoryCommitType commit_type) { |
+void RenderFrameImpl::SendDidCommitProvisionalLoad(blink::WebFrame* frame) { |
DCHECK(!frame_ || frame_ == frame); |
WebDataSource* ds = frame->dataSource(); |
DCHECK(ds); |
@@ -3684,7 +3682,7 @@ |
render_view_->navigation_gesture_ = NavigationGestureUnknown; |
// Make navigation state a part of the DidCommitProvisionalLoad message so |
- // that committed entry has it at all times. |
+ // that commited entry has it at all times. |
HistoryEntry* entry = render_view_->history_controller()->GetCurrentEntry(); |
if (entry) |
params.page_state = HistoryEntryToPageState(entry); |
@@ -3789,12 +3787,13 @@ |
// Subframe navigation: the type depends on whether this navigation |
// generated a new session history entry. When they do generate a session |
// history entry, it means the user initiated the navigation and we should |
- // mark it as such. |
- bool is_history_navigation = commit_type == blink::WebBackForwardCommit; |
- if (is_history_navigation || ds->replacesCurrentHistoryItem()) |
+ // mark it as such. This test checks if this is the first time |
+ // SendDidCommitProvisionalLoad has been called since WillNavigateToURL was |
+ // called to initiate the load. |
+ if (render_view_->page_id_ > render_view_->last_page_id_sent_to_browser_) |
+ params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME; |
+ else |
params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; |
- else |
- params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME; |
DCHECK(!navigation_state->history_list_was_cleared()); |
params.history_list_was_cleared = false; |
@@ -3804,6 +3803,10 @@ |
if (!is_swapped_out()) |
Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params)); |
} |
+ |
+ render_view_->last_page_id_sent_to_browser_ = |
+ std::max(render_view_->last_page_id_sent_to_browser_, |
+ render_view_->page_id_); |
// If we end up reusing this WebRequest (for example, due to a #ref click), |
// we don't want the transition type to persist. Just clear it. |