From 99e2dbd6e88624e3b6b66c34b6664ecdaa3c8df4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:13:17 -0700 Subject: [PATCH] Fix inspectable_web_contents_impl.h --- brightray/browser/inspectable_web_contents_impl.cc | 10 ++++++---- brightray/browser/inspectable_web_contents_impl.h | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 4fae3a1ae1..0e09fba1a3 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -317,10 +317,11 @@ void InspectableWebContentsImpl::AgentHostClosed( content::DevToolsAgentHost* agent_host, bool replaced) { } -void InspectableWebContentsImpl::AboutToNavigateRenderView( - content::RenderViewHost* render_view_host) { - frontend_host_.reset(content::DevToolsFrontendHost::Create( - render_view_host, this)); +void InspectableWebContentsImpl::AboutToNavigateRenderFrame( + content::RenderFrameHost* new_host) { + if (new_host->GetParent()) + return; + frontend_host_.reset(content::DevToolsFrontendHost::Create(new_host, this)); } void InspectableWebContentsImpl::DidFinishLoad(content::RenderFrameHost* render_frame_host, @@ -355,6 +356,7 @@ bool InspectableWebContentsImpl::AddMessageToConsole( bool InspectableWebContentsImpl::ShouldCreateWebContents( content::WebContents* web_contents, int route_id, + int main_frame_route_id, WindowContainerType window_container_type, const base::string16& frame_name, const GURL& target_url, diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 075ee320d9..7e249e8aa6 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -104,7 +104,7 @@ class InspectableWebContentsImpl : bool replaced) override; // content::WebContentsObserver: - void AboutToNavigateRenderView(content::RenderViewHost* render_view_host) override; + void AboutToNavigateRenderFrame(content::RenderFrameHost* new_host) override; void DidFinishLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url) override; void WebContentsDestroyed() override; @@ -118,6 +118,7 @@ class InspectableWebContentsImpl : bool ShouldCreateWebContents( content::WebContents* web_contents, int route_id, + int main_frame_route_id, WindowContainerType window_container_type, const base::string16& frame_name, const GURL& target_url,