Chromium Code Reviews| Index: content/renderer/render_frame_impl.cc |
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
| index 74f98124c3c580eaa7dfc12deb612f31a9664162..a2da77b91050a70f71d51578235d3ad2323bb472 100644 |
| --- a/content/renderer/render_frame_impl.cc |
| +++ b/content/renderer/render_frame_impl.cc |
| @@ -1407,6 +1407,11 @@ blink::WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
| this, frame, extra_data, request, type, default_policy, is_redirect); |
| } |
| +blink::WebHistoryItem RenderFrameImpl::historyItemForNewChildFrame( |
| + blink::WebFrame* frame) { |
| + return render_view_->webview()->itemForNewChildFrame(frame); |
|
Charlie Reis
2014/04/02 17:52:59
Should this be on WebFrame rather than WebView?
|
| +} |
| + |
| void RenderFrameImpl::willSendSubmitEvent(blink::WebFrame* frame, |
| const blink::WebFormElement& form) { |
| DCHECK(!frame_ || frame_ == frame); |
| @@ -1517,6 +1522,7 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebFrame* frame) { |
| void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( |
| blink::WebFrame* frame) { |
| DCHECK(!frame_ || frame_ == frame); |
| + render_view_->webview()->removeChildrenForRedirect(frame); |
|
Charlie Reis
2014/04/02 17:52:59
Just curious, why is this on the WebView rather th
|
| if (frame->parent()) |
| return; |
| // Received a redirect on the main frame. |
| @@ -1639,6 +1645,17 @@ void RenderFrameImpl::didFailProvisionalLoad( |
| } |
| void RenderFrameImpl::didCommitProvisionalLoad(blink::WebFrame* frame, |
|
Charlie Reis
2014/04/02 17:52:59
nit: frame should be on its own line, aligned with
Nate Chapin
2014/04/02 17:58:35
Done.
|
| + const blink::WebHistoryItem& item, |
| + blink::WebHistoryCommitType commit_type) { |
| + DocumentState* document_state = |
| + DocumentState::FromDataSource(frame->dataSource()); |
| + render_view_->webview()->updateForCommit(frame, item, commit_type, |
|
Charlie Reis
2014/04/02 17:52:59
updateForCommit should also be on WebFrame rather
|
| + document_state->navigation_state()->was_within_same_page()); |
| + |
| + didCommitProvisionalLoad(frame, commit_type == blink::WebStandardCommit); |
| +} |
| + |
| +void RenderFrameImpl::didCommitProvisionalLoad(blink::WebFrame* frame, |
| bool is_new_navigation) { |
| DCHECK(!frame_ || frame_ == frame); |
| DocumentState* document_state = |
| @@ -1859,6 +1876,27 @@ void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) { |
| } |
| void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame, |
| + const blink::WebHistoryItem& item, |
| + blink::WebHistoryCommitType commit_type) { |
| + DCHECK(!frame_ || frame_ == frame); |
| + // If this was a reference fragment navigation that we initiated, then we |
| + // could end up having a non-null pending navigation params. We just need to |
| + // update the ExtraData on the datasource so that others who read the |
| + // ExtraData will get the new NavigationState. Similarly, if we did not |
| + // initiate this navigation, then we need to take care to reset any pre- |
| + // existing navigation state to a content-initiated navigation state. |
| + // DidCreateDataSource conveniently takes care of this for us. |
| + didCreateDataSource(frame, frame->dataSource()); |
| + |
| + DocumentState* document_state = |
| + DocumentState::FromDataSource(frame->dataSource()); |
| + NavigationState* new_state = document_state->navigation_state(); |
| + new_state->set_was_within_same_page(true); |
| + |
| + didCommitProvisionalLoad(frame, item, commit_type); |
| +} |
| + |
| +void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame, |
| bool is_new_navigation) { |
| DCHECK(!frame_ || frame_ == frame); |
| // If this was a reference fragment navigation that we initiated, then we |
| @@ -1868,6 +1906,7 @@ void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame, |
| // initiate this navigation, then we need to take care to reset any pre- |
| // existing navigation state to a content-initiated navigation state. |
| // DidCreateDataSource conveniently takes care of this for us. |
| + |
|
Charlie Reis
2014/04/02 17:52:59
nit: No extra line here.
Nate Chapin
2014/04/02 17:58:35
Done.
|
| didCreateDataSource(frame, frame->dataSource()); |
| DocumentState* document_state = |