From aa926680a2aef5ba87f99169efa87464c9bbf9c3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 5 Jun 2015 12:10:01 +0800 Subject: [PATCH] No more need to override DidFinishLoad --- .../browser/inspectable_web_contents_impl.cc | 17 +++++------------ .../browser/inspectable_web_contents_impl.h | 2 -- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 3242316989f0..5d109e123e0b 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -284,6 +284,11 @@ void InspectableWebContentsImpl::CloseWindow() { void InspectableWebContentsImpl::LoadCompleted() { frontend_loaded_ = true; + view_->ShowDevTools(); + + // If the devtools can dock, "SetIsDocked" will be called by devtools itself. + if (!can_dock_) + SetIsDocked(DispatchCallback(), false); } void InspectableWebContentsImpl::SetInspectedPageBounds(const gfx::Rect& rect) { @@ -482,18 +487,6 @@ void InspectableWebContentsImpl::AboutToNavigateRenderFrame( frontend_host_.reset(content::DevToolsFrontendHost::Create(new_host, this)); } -void InspectableWebContentsImpl::DidFinishLoad(content::RenderFrameHost* render_frame_host, - const GURL& validated_url) { - if (render_frame_host->GetParent()) - return; - - view_->ShowDevTools(); - - // If the devtools can dock, "SetIsDocked" will be called by devtools itself. - if (!can_dock_) - SetIsDocked(DispatchCallback(), false); -} - void InspectableWebContentsImpl::WebContentsDestroyed() { Observe(nullptr); Detach(); diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index aec9548b98a7..249d0867daa5 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -128,8 +128,6 @@ class InspectableWebContentsImpl : // content::WebContentsObserver: void AboutToNavigateRenderFrame(content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) override; - void DidFinishLoad(content::RenderFrameHost* render_frame_host, - const GURL& validated_url) override; void WebContentsDestroyed() override; // content::WebContentsDelegate: