#include "content/browser/browser_url_handler_impl.h"
#include "content/browser/frame_host/cross_process_frame_connector.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
+#include "content/browser/frame_host/navigator.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/site_instance_impl.h"
+#include "content/common/frame_messages.h"
#include "content/common/view_messages.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
const GURL& url,
const Referrer& referrer,
PageTransition transition) {
- ViewHostMsg_FrameNavigate_Params params;
+ FrameHostMsg_DidCommitProvisionalLoad_Params params;
params.page_id = page_id;
params.url = url;
params.is_post = false;
params.page_state = PageState::CreateFromURL(url);
- DidNavigate(render_view_host, params);
+ RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(render_view_host);
+ RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(
+ rvh->GetProcess()->GetID(), rvh->main_frame_routing_id());
+ frame_tree_.root()->navigator()->DidNavigate(rfh, params);
}
WebPreferences TestWebContents::TestGetWebkitPrefs() {
page_id = GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()) + 1;
}
- // Simulate the SwapOut_ACK that happens when we swap out the old
- // RVH, before the navigation commits. This is needed when
- // cross-site navigation happens (old_rvh != rvh).
+ rvh->SendNavigate(page_id, entry->GetURL());
+ // Simulate the SwapOut_ACK. This is needed when cross-site navigation happens
+ // (old_rvh != rvh).
if (old_rvh != rvh)
static_cast<RenderViewHostImpl*>(old_rvh)->OnSwappedOut(false);
- rvh->SendNavigate(page_id, entry->GetURL());
}
void TestWebContents::ProceedWithCrossSiteNavigation() {
bool is_main_frame,
int error_code,
const base::string16& error_description) {
- ViewHostMsg_DidFailLoadWithError msg(
+ FrameHostMsg_DidFailLoadWithError msg(
0, frame_id, url, is_main_frame, error_code, error_description);
- OnMessageReceived(GetRenderViewHost(), msg);
+ frame_tree_.root()->current_frame_host()->OnMessageReceived(msg);
}
void TestWebContents::CreateNewWindow(