Merge pull request #1719 from deepak1556/service_worker_patch

devtools: api to inspect service worker
This commit is contained in:
Cheng Zhao 2015-05-27 15:47:41 +08:00
commit 4a376694b4
9 changed files with 41 additions and 1 deletions

View file

@ -314,6 +314,17 @@ void NativeWindow::InspectElement(int x, int y) {
agent->InspectElement(x, y);
}
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;
}
}
}
void NativeWindow::FocusOnWebView() {
GetWebContents()->GetRenderViewHost()->Focus();
}