diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-25 16:03:10 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-26 08:46:04 +0000 |
commit | 916b91146814fa16bab990dec3fea97bff334380 (patch) | |
tree | a80a9c464a49d074db4368a103434174a4fa10e5 /src/core/web_contents_adapter.cpp | |
parent | 2ce9eebf27d73296ff23e2f936b68f22f96ac38d (diff) |
Add inspect element webaction
Adds the missing InspectElement webaction from QtWebKit. It is not added
by to any context menus by default and only has an effect when an
inspector is attached.
Change-Id: Ic8c67c797e5dfe266fb692ffc97577b842458a79
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index cb9cb012b..1e0d261da 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -58,6 +58,7 @@ #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/child_process_security_policy.h" +#include "content/public/browser/devtools_agent_host.h" #include <content/public/browser/download_manager.h> #include "content/public/browser/host_zoom_map.h" #include "content/public/browser/navigation_entry.h" @@ -791,6 +792,14 @@ void WebContentsAdapter::executeMediaPlayerActionAt(const QPoint &location, Medi d->webContents->GetRenderViewHost()->ExecuteMediaPlayerActionAtLocation(toGfx(location), blinkAction); } +void WebContentsAdapter::inspectElementAt(const QPoint &location) +{ + Q_D(WebContentsAdapter); + if (content::DevToolsAgentHost::HasFor(d->webContents.get())) { + content::DevToolsAgentHost::GetOrCreateFor(d->webContents.get())->InspectElement(location.x(), location.y()); + } +} + void WebContentsAdapter::wasShown() { Q_D(WebContentsAdapter); |