From: Cheng Zhao Date: Mon, 24 Feb 2014 02:09:32 +0000 (+0800) Subject: Setup devtools client for the correct contents. X-Git-Tag: v0.10.0~4^2~5 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=1f57994e2ac349a64824b9b112d7a3272216f012;p=electron.git Setup devtools client for the correct contents. --- diff --git a/browser/native_window.cc b/browser/native_window.cc index caa191b0..ee2a2bc8 100644 --- a/browser/native_window.cc +++ b/browser/native_window.cc @@ -207,16 +207,16 @@ void NativeWindow::DebugDevTools() { devtools_web_contents->GetRenderViewHost()); content::DevToolsClientHost* frontend_host = content::DevToolsClientHost::CreateDevToolsFrontendHost( - devtools_web_contents, window); + window->GetWebContents(), window); content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor( agent_host, frontend_host); window->InitFromOptions(&options); window->GetWebContents()->GetController().LoadURL( - GURL("chrome-devtools://devtools/devtools.html"), - content::Referrer(), - content::PAGE_TRANSITION_AUTO_TOPLEVEL, - std::string()); + GURL("chrome-devtools://devtools/devtools.html"), + content::Referrer(), + content::PAGE_TRANSITION_AUTO_TOPLEVEL, + std::string()); } void NativeWindow::FocusOnWebView() { @@ -487,8 +487,8 @@ void NativeWindow::DispatchOnEmbedder(const std::string& message) { } void NativeWindow::InspectedContentsClosing() { - // We are acting as devtools debugger, safe to delete here. - delete this; + // We are acting as devtools debugger, safe to close here. + CloseImmediately(); } void NativeWindow::OnCapturePageDone(const CapturePageCallback& callback,