Merge pull request #1839 from deepak1556/devtools_api_patch

devtools: initialise devtoolsWebContents when opened with inspect* apis
This commit is contained in:
Cheng Zhao 2015-06-03 18:31:25 +08:00
commit 912ed2ca10
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;
}