Commit 68057554 authored by japhet@chromium.org's avatar japhet@chromium.org

Call currently unimplemented history shims on WebView

This is step 2 of 5 in moving HistoryController to content/, as described in http://crbug.com/357327

These calls will allow content/ to be responsible for updating history state in step 3, and eventually to implement history state management in step 4.

BUG=357327

Review URL: https://codereview.chromium.org/218993014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261458 0039d316-1c4b-4281-b951-d872f2087c98
parent e034a2eb
...@@ -1480,6 +1480,11 @@ blink::WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( ...@@ -1480,6 +1480,11 @@ blink::WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
this, frame, extra_data, request, type, default_policy, is_redirect); this, frame, extra_data, request, type, default_policy, is_redirect);
} }
blink::WebHistoryItem RenderFrameImpl::historyItemForNewChildFrame(
blink::WebFrame* frame) {
return render_view_->webview()->itemForNewChildFrame(frame);
}
void RenderFrameImpl::willSendSubmitEvent(blink::WebFrame* frame, void RenderFrameImpl::willSendSubmitEvent(blink::WebFrame* frame,
const blink::WebFormElement& form) { const blink::WebFormElement& form) {
DCHECK(!frame_ || frame_ == frame); DCHECK(!frame_ || frame_ == frame);
...@@ -1590,6 +1595,7 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebFrame* frame) { ...@@ -1590,6 +1595,7 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebFrame* frame) {
void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad(
blink::WebFrame* frame) { blink::WebFrame* frame) {
DCHECK(!frame_ || frame_ == frame); DCHECK(!frame_ || frame_ == frame);
render_view_->webview()->removeChildrenForRedirect(frame);
if (frame->parent()) if (frame->parent())
return; return;
// Received a redirect on the main frame. // Received a redirect on the main frame.
...@@ -1711,6 +1717,18 @@ void RenderFrameImpl::didFailProvisionalLoad( ...@@ -1711,6 +1717,18 @@ void RenderFrameImpl::didFailProvisionalLoad(
frame, failed_request, error, replace); frame, failed_request, error, replace);
} }
void RenderFrameImpl::didCommitProvisionalLoad(
blink::WebFrame* frame,
const blink::WebHistoryItem& item,
blink::WebHistoryCommitType commit_type) {
DocumentState* document_state =
DocumentState::FromDataSource(frame->dataSource());
render_view_->webview()->updateForCommit(frame, item, commit_type,
document_state->navigation_state()->was_within_same_page());
didCommitProvisionalLoad(frame, commit_type == blink::WebStandardCommit);
}
void RenderFrameImpl::didCommitProvisionalLoad(blink::WebFrame* frame, void RenderFrameImpl::didCommitProvisionalLoad(blink::WebFrame* frame,
bool is_new_navigation) { bool is_new_navigation) {
DCHECK(!frame_ || frame_ == frame); DCHECK(!frame_ || frame_ == frame);
...@@ -1931,6 +1949,27 @@ void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) { ...@@ -1931,6 +1949,27 @@ void RenderFrameImpl::didFinishLoad(blink::WebFrame* frame) {
ds->request().url())); ds->request().url()));
} }
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, void RenderFrameImpl::didNavigateWithinPage(blink::WebFrame* frame,
bool is_new_navigation) { bool is_new_navigation) {
DCHECK(!frame_ || frame_ == frame); DCHECK(!frame_ || frame_ == frame);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "ipc/ipc_message.h" #include "ipc/ipc_message.h"
#include "third_party/WebKit/public/web/WebDataSource.h" #include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebFrameClient.h" #include "third_party/WebKit/public/web/WebFrameClient.h"
#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
#include "ui/gfx/range/range.h" #include "ui/gfx/range/range.h"
class TransportDIB; class TransportDIB;
...@@ -242,6 +243,8 @@ class CONTENT_EXPORT RenderFrameImpl ...@@ -242,6 +243,8 @@ class CONTENT_EXPORT RenderFrameImpl
blink::WebNavigationType type, blink::WebNavigationType type,
blink::WebNavigationPolicy default_policy, blink::WebNavigationPolicy default_policy,
bool is_redirect); bool is_redirect);
virtual blink::WebHistoryItem historyItemForNewChildFrame(
blink::WebFrame* frame);
virtual void willSendSubmitEvent(blink::WebFrame* frame, virtual void willSendSubmitEvent(blink::WebFrame* frame,
const blink::WebFormElement& form); const blink::WebFormElement& form);
virtual void willSubmitForm(blink::WebFrame* frame, virtual void willSubmitForm(blink::WebFrame* frame,
...@@ -254,6 +257,11 @@ class CONTENT_EXPORT RenderFrameImpl ...@@ -254,6 +257,11 @@ class CONTENT_EXPORT RenderFrameImpl
virtual void didFailProvisionalLoad( virtual void didFailProvisionalLoad(
blink::WebFrame* frame, blink::WebFrame* frame,
const blink::WebURLError& error); const blink::WebURLError& error);
virtual void didCommitProvisionalLoad(
blink::WebFrame* frame,
const blink::WebHistoryItem& item,
blink::WebHistoryCommitType commit_type);
// DEPRECATED
virtual void didCommitProvisionalLoad(blink::WebFrame* frame, virtual void didCommitProvisionalLoad(blink::WebFrame* frame,
bool is_new_navigation); bool is_new_navigation);
virtual void didClearWindowObject(blink::WebFrame* frame, int world_id); virtual void didClearWindowObject(blink::WebFrame* frame, int world_id);
...@@ -268,6 +276,10 @@ class CONTENT_EXPORT RenderFrameImpl ...@@ -268,6 +276,10 @@ class CONTENT_EXPORT RenderFrameImpl
virtual void didFailLoad(blink::WebFrame* frame, virtual void didFailLoad(blink::WebFrame* frame,
const blink::WebURLError& error); const blink::WebURLError& error);
virtual void didFinishLoad(blink::WebFrame* frame); virtual void didFinishLoad(blink::WebFrame* frame);
virtual void didNavigateWithinPage(blink::WebFrame* frame,
const blink::WebHistoryItem& item,
blink::WebHistoryCommitType commit_type);
// DEPRECATED
virtual void didNavigateWithinPage(blink::WebFrame* frame, virtual void didNavigateWithinPage(blink::WebFrame* frame,
bool is_new_navigation); bool is_new_navigation);
virtual void didUpdateCurrentHistoryItem(blink::WebFrame* frame); virtual void didUpdateCurrentHistoryItem(blink::WebFrame* frame);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment