No more need to override DidFinishLoad

This commit is contained in:
Cheng Zhao 2015-06-05 12:10:01 +08:00
parent 95d28c398e
commit aa926680a2
2 changed files with 5 additions and 14 deletions

View file

@ -284,6 +284,11 @@ void InspectableWebContentsImpl::CloseWindow() {
void InspectableWebContentsImpl::LoadCompleted() { void InspectableWebContentsImpl::LoadCompleted() {
frontend_loaded_ = true; 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) { void InspectableWebContentsImpl::SetInspectedPageBounds(const gfx::Rect& rect) {
@ -482,18 +487,6 @@ void InspectableWebContentsImpl::AboutToNavigateRenderFrame(
frontend_host_.reset(content::DevToolsFrontendHost::Create(new_host, this)); 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() { void InspectableWebContentsImpl::WebContentsDestroyed() {
Observe(nullptr); Observe(nullptr);
Detach(); Detach();

View file

@ -128,8 +128,6 @@ class InspectableWebContentsImpl :
// content::WebContentsObserver: // content::WebContentsObserver:
void AboutToNavigateRenderFrame(content::RenderFrameHost* old_host, void AboutToNavigateRenderFrame(content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) override; content::RenderFrameHost* new_host) override;
void DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) override;
void WebContentsDestroyed() override; void WebContentsDestroyed() override;
// content::WebContentsDelegate: // content::WebContentsDelegate: