WebContents::InspectElement and WebContents::InspenctServiceWorker return immediately if DevTools is disabled

This commit is contained in:
minggo 2016-09-06 17:53:42 +08:00
parent 2db5aa8294
commit 91fb85947d

View file

@ -1012,6 +1012,9 @@ void WebContents::InspectElement(int x, int y) {
if (type_ == REMOTE)
return;
if (disable_devtools_)
return;
if (!managed_web_contents()->GetDevToolsWebContents())
OpenDevTools(nullptr);
scoped_refptr<content::DevToolsAgentHost> agent(
@ -1023,6 +1026,9 @@ void WebContents::InspectServiceWorker() {
if (type_ == REMOTE)
return;
if (disable_devtools_)
return;
for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
if (agent_host->GetType() ==
content::DevToolsAgentHost::TYPE_SERVICE_WORKER) {