diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index f143768ec348..48da9f1fb005 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -74,6 +74,7 @@ void InspectableWebContentsImpl::ShowDevTools() { agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(web_contents_->GetRenderViewHost()); frontend_host_.reset(content::DevToolsClientHost::CreateDevToolsFrontendHost(devtools_web_contents_.get(), this)); + content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(agent_host_, frontend_host_.get()); devtools_web_contents_->GetController().LoadURL(GetDevToolsURL(), content::Referrer(), content::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); } @@ -145,8 +146,10 @@ void InspectableWebContentsImpl::InspectedContentsClosing() { } void InspectableWebContentsImpl::RenderViewCreated(content::RenderViewHost* render_view_host) { +} + +void InspectableWebContentsImpl::AboutToNavigateRenderView(content::RenderViewHost* render_view_host) { content::DevToolsClientHost::SetupDevToolsFrontendClient(web_contents()->GetRenderViewHost()); - content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(agent_host_, frontend_host_.get()); } void InspectableWebContentsImpl::DidFinishLoad(int64, const GURL&, bool is_main_frame, content::RenderViewHost*) { diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index b2a772047207..c47eb871cd6e 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -70,6 +70,7 @@ private: // content::WebContentsObserver virtual void RenderViewCreated(content::RenderViewHost*) OVERRIDE; + virtual void AboutToNavigateRenderView(content::RenderViewHost* render_view_host) OVERRIDE; virtual void DidFinishLoad(int64 frame_id, const GURL& validated_url, bool is_main_frame,