Call InspectElement directly on InspectableWebContents
authorKevin Sawicki <kevinsawicki@gmail.com>
Tue, 20 Dec 2016 00:25:32 +0000 (16:25 -0800)
committerBirunthan Mohanathas <birunthan@mohanathas.com>
Thu, 19 Jan 2017 07:05:59 +0000 (09:05 +0200)
atom/browser/api/atom_api_web_contents.cc

index 3d1c247..c4762c1 100644 (file)
@@ -1062,10 +1062,7 @@ void WebContents::InspectElement(int x, int y) {
 
   if (!managed_web_contents()->GetDevToolsWebContents())
     OpenDevTools(nullptr);
-  scoped_refptr<content::DevToolsAgentHost> agent(
-    content::DevToolsAgentHost::GetOrCreateFor(web_contents()));
-  // FIXME(zcbenz): Figure out how to implement this for Chrome 54.
-  agent->InspectElement(nullptr, x, y);
+  managed_web_contents()->InspectElement(x, y);
 }
 
 void WebContents::InspectServiceWorker() {