Fix loading of the DevTools window.

- The devtools.html file has been renamed to inspector.html.
This commit is contained in:
Marshall Greenblatt 2015-07-31 16:54:54 -04:00
parent 96e116de9e
commit 5f0720e096
2 changed files with 9 additions and 3 deletions

View File

@ -112,7 +112,7 @@ std::string CefDevToolsDelegate::GetFrontendResource(
} }
std::string CefDevToolsDelegate::GetChromeDevToolsURL() { std::string CefDevToolsDelegate::GetChromeDevToolsURL() {
return base::StringPrintf("%s://%s/devtools.html", return base::StringPrintf("%s://%s/inspector.html",
content::kChromeDevToolsScheme, scheme::kChromeDevToolsHost); content::kChromeDevToolsScheme, scheme::kChromeDevToolsHost);
} }

View File

@ -186,10 +186,16 @@ void CefDevToolsFrontend::RenderViewCreated(
} }
void CefDevToolsFrontend::DocumentAvailableInMainFrame() { void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
agent_host_ = // Don't call AttachClient multiple times for the same DevToolsAgentHost.
// Otherwise it will call AgentHostClosed which closes the DevTools window.
// This may happen in cases where the DevTools content fails to load.
scoped_refptr<content::DevToolsAgentHost> agent_host =
content::DevToolsAgentHost::GetOrCreateFor(inspected_contents_); content::DevToolsAgentHost::GetOrCreateFor(inspected_contents_);
if (agent_host != agent_host_) {
agent_host_ = agent_host;
agent_host_->AttachClient(this); agent_host_->AttachClient(this);
} }
}
void CefDevToolsFrontend::WebContentsDestroyed() { void CefDevToolsFrontend::WebContentsDestroyed() {
if (agent_host_) if (agent_host_)