devtools: initialise devtoolsWebContents when opened with inspect* apis

This commit is contained in:
deepak1556 2015-06-01 17:23:44 +05:30
parent ad851547e0
commit 67a9931b55
3 changed files with 10 additions and 4 deletions

View file

@ -308,7 +308,6 @@ bool NativeWindow::IsDevToolsOpened() {
}
void NativeWindow::InspectElement(int x, int y) {
OpenDevTools(true);
scoped_refptr<content::DevToolsAgentHost> agent(
content::DevToolsAgentHost::GetOrCreateFor(GetWebContents()));
agent->InspectElement(x, y);
@ -318,7 +317,6 @@ void NativeWindow::InspectServiceWorker() {
for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
if (agent_host->GetType() ==
content::DevToolsAgentHost::TYPE_SERVICE_WORKER) {
OpenDevTools(true);
inspectable_web_contents()->AttachTo(agent_host);
break;
}