diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-26 13:29:19 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-09-01 08:02:00 +0000 |
commit | f0683845f2577da697c8ae6b86dd0226d0488562 (patch) | |
tree | 87055de8158c1c5c76ea3469a38fd5ce25bb655c /src/core/web_contents_adapter.cpp | |
parent | 60935a502b5d4cf07e49be99f91c19a1c7644fd5 (diff) |
Add default inspect element context menu item
Adds inspect element to the context menu when there is an attached
inspector on the page.
Change-Id: Id3c8a5be34318c12ab331b6611219bd59b7b70be
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 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index a01164f1a..ab4a02836 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -800,6 +800,14 @@ void WebContentsAdapter::inspectElementAt(const QPoint &location) } } +bool WebContentsAdapter::hasInspector() const +{ + const Q_D(WebContentsAdapter); + if (content::DevToolsAgentHost::HasFor(d->webContents.get())) + return content::DevToolsAgentHost::GetOrCreateFor(d->webContents.get())->IsAttached(); + return false; +} + void WebContentsAdapter::exitFullScreen() { Q_D(WebContentsAdapter); |